Db connectivity is handled by an include.
I want to run this command: mysql_close($con);
Only if we currently have a connection. Something like isset()?
Thanks Hamad
Db connectivity is handled by an include.
I want to run this command: mysql_close($con);
Only if we currently have a connection. Something like isset()?
Thanks Hamad
You can use mysql_ping($con);
Depending on your PHP version, the older ones would reopen the connection if it was closed automatically. It shouldn't do that in PHP5
You can test the connection by doing a simple mysql_ping
, which will re-open the connection if it's closed.