[nycphp-talk] mysql_close() error
Frank Wong
frank_wong2 at informationideas.com
Tue Dec 21 16:52:50 EST 2004
The interesting thing is if I explicitly force mysql_connect to open a new
connection by using
****************************************************************************
*******************************************
// Connecting, selecting database //
$link = mysql_connect($host, $sys_user, $sys_password, TRUE)
or show_error_page("Could not connect : " . mysql_error());
mysql_select_db($sys_db) or show_error_page("Could not select database");
****************************************************************************
*******************************************
I get the error message
****************************************************************************
*******************************************
Warning: mysql_close(): 14 is not a valid MySQL-Link resource
****************************************************************************
*******************************************
instead of the original error message without explicitly forcing a new
connection
****************************************************************************
*******************************************
Warning: mysql_close(): 12 is not a valid MySQL-Link resource
****************************************************************************
*******************************************
Do those numbers represent something? Error number or anything else?
Frank
-----Original Message-----
From: talk-bounces at lists.nyphp.org
[mailto:talk-bounces at lists.nyphp.org]On Behalf Of csnyder
Sent: Tuesday, December 21, 2004 4:30 PM
To: NYPHP Talk
Subject: Re: [nycphp-talk] mysql_close() error
Not an answer to your question, but unless you explicitly need to
close the db connection (because your script is running in daemon mode
or something) you can leave out the mysql_close() -- the connection is
closed automatically once execution is finished.
Still, that's perplexing. Do you do anything to $link that would cause
it to be recast as a string or int?
_______________________________________________
New York PHP Talk
Supporting AMP Technology (Apache/MySQL/PHP)
http://lists.nyphp.org/mailman/listinfo/talk
http://www.newyorkphp.org
More information about the talk
mailing list