note 68300 added to function.mysql-client-encoding
| From: | php-general at lists dot php dot net | Date: | Fri, 21 Jul 2006 12:46:29 +0000 |
| Subject: | note 68300 added to function.mysql-client-encoding | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-115011@lists.php.net to get a copy of this message | ||
A very easy way to always get results in UTF-8 is to make a common function to connect to DB and in
that function set character set to utf-8.
function OpenConn() {
global $link;
$link = mysql_connect ("localhost", "username", "password")
or die(sendError('Could not connect to DB'));
mysql_select_db ("dbName");
//
// Set character set to UTF-8
//
mysql_query("SET CHARACTER SET 'utf8'", $link);
}
----
Server IP: 129.16.214.50
Probable Submitter: 81.170.211.84
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.mysql-client-encoding.php
Edit -- http://master.php.net/note/edit/68300
Del: integrated -- http://master.php.net/note/delete/68300/integrated
Del: useless -- http://master.php.net/note/delete/68300/useless
Del: bad code -- http://master.php.net/note/delete/68300/bad+code
Del: spam -- http://master.php.net/note/delete/68300/spam
Del: non-english -- http://master.php.net/note/delete/68300/non-english
Del: in docs -- http://master.php.net/note/delete/68300/in+docs
Del: other reasons-- http://master.php.net/note/delete/68300
Reject -- http://master.php.net/note/reject/68300
Search -- http://master.php.net/manage/user-notes.php