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 );