Mysqli class does not have a query function?

Source: Internet
Author: User
I use the function to provide a database connection function, most of the situation is allowed to normal, but recently the following error prompt:
Fatal Error:call to a member function query () on a non-object in h:\w ..., sometimes refreshing under the good, it is strange, who knows why?


Reply to discussion (solution)

This is a Mysqli object that does not exist. Determine if the Mysqli object is valid before calling query

The reason for this error is that the object of your object does not exist, just a name.

Sometimes the refresh under the good, is not possible, just after the refresh is not executed to the problematic code

The error message comes with the file name and line number at the time of the error, and you can find the problem based on them.

The reason for this error is that the object of your object does not exist, just a name.

Sometimes the refresh under the good, is not possible, just after the refresh is not executed to the problematic code

The error message comes with the file name and line number at the time of the error, and you can find the problem based on them.
I also think it is impossible, clearly the context provides a connection function, the study of a half-day did not complete the why. If the number of queries is small, such as less than 100, if you query thousands of, this problem occurs. Before I can tell, it's just a ghost.

It's going to see your code.
Maybe when you're working with the query results, you happen to overwrite the variable with the same name.

The original is a 10048 error, is my database connection problem.

  • 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.