Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using mysql_close()

Tags:

php

mysql

is it necessary to use mysql_close() at the end of a query in PHP?

like image 537
phpFreak Avatar asked Jan 14 '10 15:01

phpFreak


2 Answers

In the manual :

mysql_close() closes the non-persistent connection to the MySQL server that's associated with the specified link identifier.

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

More reading about that here

like image 138
marcgg Avatar answered Oct 12 '22 00:10

marcgg


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.

read more at :

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

like image 37
Haim Evgi Avatar answered Oct 12 '22 00:10

Haim Evgi