note 79874 added to function.mysql-set-charset

From: Date: Mon, 17 Dec 2007 15:47:38 +0000
Subject: note 79874 added to function.mysql-set-charset
Groups: php.notes 
Request: Send a blank email to php-notes+get-133727@lists.php.net to get a copy of this message
Here's an improved version of Janez R.'s function: <?php if (function_exists('mysql_set_charset') === false) { /** * Sets the client character set. * * Note: This function requires MySQL 5.0.7 or later. * * @see http://www.php.net/mysql-set-charset * @param string $charset A valid character set name * @param resource $link_identifier The MySQL connection * @return TRUE on success or FALSE on failure */ function mysql_set_charset($charset, $link_identifier = null) { if ($link_identifier == null) { return mysql_query('SET CHARACTER SET "'.$charset.'"'); } else { return mysql_query('SET CHARACTER SET "'.$charset.'"', $link_identifier); } } } ?> ---- Server IP: 217.174.196.197 Probable Submitter: 83.203.187.140 ---- Manual Page -- http://www.php.net/manual/en/function.mysql-set-charset.php Edit -- https://master.php.net/note/edit/79874 Del: integrated -- https://master.php.net/note/delete/79874/integrated Del: useless -- https://master.php.net/note/delete/79874/useless Del: bad code -- https://master.php.net/note/delete/79874/bad+code Del: spam -- https://master.php.net/note/delete/79874/spam Del: non-english -- https://master.php.net/note/delete/79874/non-english Del: in docs -- https://master.php.net/note/delete/79874/in+docs Del: other reasons-- https://master.php.net/note/delete/79874 Reject -- https://master.php.net/note/reject/79874 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#133727) next »