Does mysql_set_character change the characterset of ALL dbs?
Posted: Tue Aug 10, 2010 3:38 am
Hello,
i use php and mysql together.
i would like to modify the character set of a SPECIFIC database.
i do :
is the previous code going to change the character set of ALL the databases??
cause in the following link for mysql_set_character http://php.net/manual/en/function.mysql-set-charset.php
in the user contribution,in second contribution a user says :
"Be careful when working with multiple databases via the same user/host that you specify "true" as the fourth argument to mysql_connect(), otherwise when you call this function it will set both db connections to the same character set."
so what shall i do in order not to modify the character sets of all databases?? and only change the one i want??
thanks, in advance!
i use php and mysql together.
i would like to modify the character set of a SPECIFIC database.
i do :
Code: Select all
if (USE_PCONNECT == 'true') {
$$link = mysql_pconnect($server, $username, $password);
mysql_set_charset('utf8',$$link);
} else {
$$link = mysql_connect($server, $username, $password);
mysql_set_charset('utf8',$$link);
}
cause in the following link for mysql_set_character http://php.net/manual/en/function.mysql-set-charset.php
in the user contribution,in second contribution a user says :
"Be careful when working with multiple databases via the same user/host that you specify "true" as the fourth argument to mysql_connect(), otherwise when you call this function it will set both db connections to the same character set."
so what shall i do in order not to modify the character sets of all databases?? and only change the one i want??
thanks, in advance!