Jump to content

[Suggestion] Mysql connection charset option!


Guest evgen

Insert mysql query "SET NAMES charset" in IPB forum core?  

11 members have voted

You do not have permission to vote in this poll, or see the poll results. Please sign in or register to vote in this poll.

Recommended Posts

Posted

Hello.
I and other semi-english users would like to see mysql query
"SET NAMES $mysqlconnectioncharset " in forum core.
Its very important thing when moving to new international hosting without ability to choose connection encoding to database at mysql 5.x.x!
By default IPB doesn't have this query, but many users have a troubles when moving to new hosters with strange mysql configuration.
I suggest create this simple setting in general configuration of forum:
post-69813-1191437282_thumb.jpg
I thing its not a big problem for IPS coders, but very helpfull and frendly setting for users!


about this query: http://dev.mysql.com/doc/refman/5.1/en/cha...connection.html
Please, users who has a problems with database encoding and new hosters, join this suggestion!

ps. sorry for english

Posted

Probably wouldn't be a horrible idea.. Do something similar to what was just done for alternate ports on mysqli connections? Add a

$INFO['sql_charset'] = 'cp1251';

to the conf_global.php if it needs to be there? For users that don't require it.. Doesn't need to be there?

If that'd work.. I'm all for it. Charset issues leave me with a migrane.

Posted

Probably wouldn't be a horrible idea.. Do something similar to what was just done for alternate ports on mysqli connections? Add a



$INFO['sql_charset'] = 'cp1251';



to the conf_global.php if it needs to be there? For users that don't require it.. Doesn't need to be there?



If that'd work.. I'm all for it. Charset issues leave me with a migrane.


Yes, it would be very nice!
For users who dont need it, just dont enter this string in global.conf .

as example:

in ips_kernel/class_db_mysql_client.php and ips_kernel/class_db_mysqli_client.php
immediately before the return true statement in the connect function as says support (thanks to Keith J. Kacin) to me.

Add something like this:

if($INFO['sql_charset']){
//--------
// charset entered in global conf
//--------
$this->query( "SET NAMES ".$INFO['sql_charset'] );
}else{
//--------
// charset by default
//--------
}


I am not best php coder, just as example :)
but this is very important setting

Posted
The trouble with that bit of code evgen, is that it would do that query EVERY time a page is loaded, because it is required by index.php, and index.php is where everything runs off.

Ignore me, its a different file your on about :lol:

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...