Db connectivity is handled with include.
I want to run this command: mysql_close ($ CON);
Only if we have a connection. Something like isset ()?
Thanks Hamad
is_resource($con)
gives falseif the connection is closed.
false
you can use mysql_ping($con);
mysql_ping($con);
Depending on your version of PHP, seniors will open the connection if it was automatically closed. This should not be done in PHP5
, mysql_ping, , .
mysql_ping
@Artefacto, , $con , , :
$con
Notice: Undefined variable: con in...
:
if ( is_resource($con)) { mysqli_close($con); }
, mysql_ping($con) .
mysql_ping($con)