note 29633 deleted from function.mysql-connect by betz
| From: | betz@php.net | Date: | Sun, 02 Oct 2005 17:00:57 +0000 |
| Subject: | note 29633 deleted from function.mysql-connect by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-96192@lists.php.net to get a copy of this message | ||
Note Submitter:
----
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
}