Home >Database >Mysql Tutorial >How to display a MySQL warning that just occurred?
To display MySQL warnings, you can use the following syntax -
SHOW WARNINGS;
The above syntax only displays immediate warnings in the MySQL prompt. SHOW WARNINGS will not work assuming you run another query between them or you lose the MySQL connection.
This is the query that shows the warning -
mysql> SHOW WARNINGS;
This is the output that shows the immediate warning -
+-------+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Level | Code | Message | +-------+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Error | 1064 | You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'QUERY CACHE' at line 1 | +-------+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec)
The above is the detailed content of How to display a MySQL warning that just occurred?. For more information, please follow other related articles on the PHP Chinese website!