How does mysql_fetch_array shield error messages without data

Source: Internet
Author: User
Tags php error
How does mysql_fetch_array block data-free errors? when I connect to a database using PHP, I use mysql_fetch_array to retrieve database data. If the table in the database has no content, an error message containing at least one element is displayed. If there is no data, no data is output, and no php error prompt is displayed, what should I do? How does mysql_fetch_array block error messages without data?
I used mysql_fetch_array to retrieve database data when connecting to the database using PHP.
If the table in the database has no content, an error message containing at least one element is displayed.
I want to output "no data" if there is no data, and no php error prompt will be displayed. what can I do?

Share: More


------ Solution --------------------
Reference:
Quote: reference:


Error_reporting (0 );
$ Query = mysql_query ($ SQL );
Mysql_fetch_array ($ query );
....
....

Error_reporting (0 );
Does this statement block all errors?


Yes. If you want to block a single error, write it like this.
@ Mysql_fetch_array ($ query );

Related Article

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.