Re: Reusing MySQL Connections - Can it be done?

From: Date: Mon, 05 Apr 2004 22:38:20 +0000
Subject: Re: Reusing MySQL Connections - Can it be done?
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-182414@lists.php.net to get a copy of this message
Monty wrote:
A define is pretty much for strings only, not objects or resources. Try using $GLOBALS['_CONNECT_DB'] instead.
I tried this, but, same results. If I store the Resource ID from a mysql_pconnect() in $GLOBALS['_CONNECT_DB'] and then call...
    mysql_query($query, $GLOBALS['_CONNECT_DB']);
PHP gives me the following error:
    4 is not a valid MySQL-Link resource
When I look into this var, here's what I see:
    Resource id #4
This is the same that was stored in the constant var, so, it appears that whether it's a Global or Constant isn't making a difference.
How are you setting the global? -- paperCrane <Justin Patrin>

« previous php.general (#182414) next »