note 29633 added to function.mysql-connect

From: Date: Wed, 19 Feb 2003 18:07:43 +0000
Subject: note 29633 added to function.mysql-connect
Groups: php.notes 
Request: Send a blank email to php-notes+get-44218@lists.php.net to get a copy of this message
ideservefreesoftware's method of forcing a new connection to be made was not practical for my customers, as setting up a new MySQL user is not an easy task for them. Instead, I was able to mimic the behaviour of the new_link parameter by tacking ":3306" to the end of the server hostname. This is fairly safe since the port of the MySQL server is almost always 3306, however I recommend only doing this if you really have to. if (!function_exists('version_compare') or version_compare(phpversion(), '4.2.0') < 0) { $config['server'] .= ':3306'; // call mysql_(p)connect() without the new_link parameter } else { // call mysql_(p)connect() with new_link set to true } -- http://www.php.net/manual/en/function.mysql-connect.php http://master.php.net/manage/user-notes.php?action=edit+29633 http://master.php.net/manage/user-notes.php?action=delete+29633 http://master.php.net/manage/user-notes.php?action=reject+29633

« previous php.notes (#44218) next »