For mysql_close (), is it best to manually close mysql_close () when using connect. ------ Solution ------------------ you need to finish the file ------ solution -------------------- This file will be available at the end ------ solution ------------ about mysql_close ()
Can you manually close mysql_close () if we use connect ()?
If necessary, where is the best place to put this statement.
------ Solution --------------------
Yes
At the end of the file, you can
------ Solution --------------------
The final part of this document is OK.
------ Solution --------------------
After the database operation is complete, mysql_close () is a good habit.
In addition, remember to use mysql_free_result () after the record set is used up.
------ Solution --------------------
Upstairs ....
------ Solution --------------------
Will be automatically disabled, of course it will be better to write
------ Solution --------------------
Yes! When used up, close it in time, and the resource will be given up
------ Solution --------------------
Learning !!
------ Solution --------------------
Discussion
After the database operation is complete, mysql_close () is a good habit.
In addition, remember to use mysql_free_result () after the record set is used up.
------ Solution --------------------
Mysql_free_result () is used to release the memory occupied by a select query, and mysql_close () is used to close a connection of mysql_connect. It is usually placed in the last line of the program (close the connection until this mysql connection is not used). Originally, php has its own function to release query resources and close the database, but manually write the program, it is a good habit to release the memory in time and close the connection.
------ Solution --------------------
Php will be automatically released, but I don't know when to release it. I haven't seen the php source code.
------ Solution --------------------
11 floor is supported...
------ Solution --------------------
No, especially for beginners! Php will complete for you
Although it is important to release resources, the release time does not bring unnecessary trouble.
For example, "If the returned query dataset is mysql_close (), it will be OK before return $ query. How can I report an error"
Mysql_query returns a system resource number. the query result is in the mysql buffer and is not passed to php. In the future, php will use this resource number to obtain data from mysql. If the connection is closed before that, how can we do it in the future?
------ Solution --------------------
The database must be closed when it is opened.
This reduces the pressure on servers, saves resources, and operates safely.
------ Solution --------------------
After reading this, I think the eighth floor is good.
------ Solution --------------------
Long knowledge
------ Solution --------------------
......
------ Solution --------------------
No. mysql_close ()
------ Solution --------------------
Lu guo