Re: using existing mysql connection in a php extension
| From: | Gareth Williams | Date: | Fri, 31 Oct 2003 13:24:24 +0000 |
| Subject: | Re: using existing mysql connection in a php extension | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-168222@lists.php.net to get a copy of this message | ||
Hi there,
Try this:
mysql_pconnect($_host, $_user, $_password) or die("Could not connect: " . mysql_error());;
This open a permanent mysql connection. The first time you run it, it opens the connection, and the second time, etc, it just uses the one already opened.
On Friday, Oct 31, 2003, at 13:14 Europe/Amsterdam, Adrian wrote:
hello, is it possible to use an existing mysql connection created from php-code $conn=mysql_connect('localhost','root','secret'); in an php-extensions, e.g. by giving the ressource id to the extension as an argument: my_extemsion_function('do_something',$conn); ? because if i have to connect to the mysql server again from my extension, i'll lose the performance-improvement gained from the faster C++-code. -- Adrian mailto:adrian@planetcoding.net www: http://www.planetcoding.net www: http://www.webskyline.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php