Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does "mysql_query() or die()" leave open mysql connection?

Does mysql_query() or die() leave open mysql connection? My thought is that it calls die() but it never calls mysql_close() on the connection...

Thanks.

like image 489
celwell Avatar asked Dec 06 '22 21:12

celwell


2 Answers

From the mysql_close docs:

Using mysql_close() isn't usually necessary, as non-persistent open links are automatically closed at the end of the script's execution. See also freeing resources

like image 179
Michael Pryor Avatar answered Dec 09 '22 12:12

Michael Pryor


http://php.net/manual/en/function.mysql-close.php

Using mysql_close() isn't usually necessary, as non-persistent open links are automatically closed at the end of the script's execution.

like image 34
Lawrence Cherone Avatar answered Dec 09 '22 10:12

Lawrence Cherone