note 26620 deleted from function.mysql-connect by didou

From: Date: Sat, 17 May 2003 19:37:49 +0000
Subject: note 26620 deleted from function.mysql-connect by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-48219@lists.php.net to get a copy of this message
Note Submitter: crypto@notup2u.net Here is a function to get the result of a MySQL query and avoid "any" connection problem. It is mostly interesting when you need to connect a lot to MySQL as you only have a few MySQL connections allowed. (Default is 3) Voici une fonction pour obtenir le résultat d'une requête MySQL et éviter "tout" problème de connection. Elle est principalement interressante lorsque vous avez besoin de vous connecter beaucoup au MySQL et que vous n'avez qu'un nombre limité de connections permises. (3 par défaut) function get_mysql_query($query,$server, $user_name, $user_pwd, $base_name){ $connection = @mysql_connect($server,$user_name,$user_pwd); while($connection == FALSE): $connection = @mysql_connect($server,$user_name,$user_pwd); endwhile; $db = @mysql_select_db($base_name, $connection); $result = @mysql($base_name,$query); $connection_close = @mysql_close($connection); return $result; } /Crypto

« previous php.notes (#48219) next »