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
is_resource($con)
gives false
if the connection is closed.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With