note 90014 added to function.mysql-set-charset

From: Date: Wed, 01 Apr 2009 22:25:48 +0000
Subject: note 90014 added to function.mysql-set-charset
Groups: php.notes 
Request: Send a blank email to php-notes+get-152728@lists.php.net to get a copy of this message
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. If you don't pass in "true" to mysql_connect() in the example below, $link1 and $link2 will have the same resource id# and both database connections will end up being set to utf-8 charsets. $link1 = mysql_connect('localhost','user1','pass1',TRUE); $link2 = mysql_connect('localhost','user1','pass1',TRUE); mysql_selectdb('db1',$link1); mysql_selectdb('db2',$link2); mysql_set_charset('latin1',$link1); mysql_set_charset('utf8',$link2); ---- Server IP: 64.71.164.2 Probable Submitter: 24.20.156.111 ---- Manual Page -- http://www.php.net/manual/en/function.mysql-set-charset.php Edit -- https://master.php.net/note/edit/90014 Del: integrated -- https://master.php.net/note/delete/90014/integrated Del: useless -- https://master.php.net/note/delete/90014/useless Del: bad code -- https://master.php.net/note/delete/90014/bad+code Del: spam -- https://master.php.net/note/delete/90014/spam Del: non-english -- https://master.php.net/note/delete/90014/non-english Del: in docs -- https://master.php.net/note/delete/90014/in+docs Del: other reasons-- https://master.php.net/note/delete/90014 Reject -- https://master.php.net/note/reject/90014 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#152728) next »