This article mainly introduces the mysql_query () function of the return value of the detailed, interested in the friend's reference, I hope to be helpful to everyone.
Problem Description:
I was working on MySQL, when inserting data, shutting down resources, PHP prompted a warning. The content is roughly, you need to give mysql_free_result () a resource type.
Then I'll return the result Var_dump ($res) and find the BOOL value
Analysis:
Looking at the manual, it seemed to me that the mysql_query () function returned a resource type, but why is it now the bool value? Well, patience to read the manual, only to find that the principle is such as film:
Summary: as you can tell, mysql_query () executes the SQL statement, not when the result set is released, but when some operations produce a result set, the call to Mysql_free_result () is released; Update this return bool value is not necessary, otherwise the superfluous
The above is the entire content of this article, I hope to be able to help you learn.