The return value of the mysql_query () function is detailed

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.