PHP failed to execute SQL statement, but the same statement can be executed in MySQL
Source: Internet
Author: User
PHP failed to execute SQL statement, but the same statement can be executed in MySQL
The problem now is that some tables in the same database can be queried, and some tables cannot be queried. But these statements can be executed in MySQL correctly.
------Solution--------------------
A situation of a situation check, LZ can be combined in PHP over the SQL statement output generated SQL statements to see if the data in the background is normal coding there is no problem to check the code of the database
------Solution--------------------
The same SQL statement can be inserted directly in the database?
Look at the SQL statement that you wrote over PHP.
------Solution--------------------
Just echo it and see what the output is.
------Solution--------------------
Permission is no problem, it must be your SQL has a problem.
Print out the final SQL to execute
------Solution--------------------
mysql_query ($sql) or Die (Mysql_error ());
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.