RE: [PHP] mysql_list_fields() bug?

From: Date: Mon, 10 Nov 2003 21:43:29 +0000
Subject: RE: [PHP] mysql_list_fields() bug?
Groups: php.general 
Request: Send a blank email to php-general+get-169093@lists.php.net to get a copy of this message
[snip] Outside of my custom function I have a mysql_pconnect() statement and a mysql_select_db() statement. So the end result being if I take the connect statement out of the function one(), it fails, but function two() still works! Am I doing something wrong here? [/snip] It's just a small misunderstanding Matt. Your $db = mysql_pconnect("ip", "user", "password"); is LOCAL to the function http://us3.php.net/language.variables.scope The other connection string you mention sits OUTSIDE of any other function, so it is GLOBAL (you didn't show that code). You are not calling for the GLOBAL connection in function one. As someone famous once said, "Location, location, location!" If you add the resource identifier to the request in function one to $fields = mysql_list_fields("db", "table", $db); it should work just fin

« previous php.general (#169093) next »