PHP Execute SQL return value problem
PHP executes the SQL return value problem,
Execute the query, the successful return is the ID, the query statement is correct, such as the ID of the query does not exist, but the query is empty return what? What does a query error return?
What is the modification, what is the successful return, the correct statement, but what is the modified null return? What do I return when I modify an error?
What is the increase in execution, what is the successful return, and what is added to the error?
What is the deletion, what is the successful return, the DELETE statement is correct, but what is the empty return? Delete error and return what?
------to solve the idea----------------------
You can check it out for yourself!
Var_dump (output query-out variable)
You can see it!
------to solve the idea----------------------
echo ' your SQL statement ';
------to solve the idea----------------------
You can add the following statements after the execution
Die ("Execution failed, error line number". __line__. " Cause of error ". Mysql_error ());
If you are unsure you can execute the mysql_query () query before executing the
echo $sql; exit ()
This will return the SQL statement and exit. Then you can check the SQL statements when stitching errors, and then you can directly in the MySQL client, such as the command line, the execution of this statement ....
The general Execution Sleect query returns a result set, and the direct if ($res) can be
Additions and deletions can be changed by calling Mysql_affected_rows () if the return-1 indicates that the execution failed
------to solve the idea----------------------
The Boolean value NULL, False, 0, "", are all represented as false,
Mysql_query returns a resource identifier for the Select,show,explain or DESCRIBE statement and prints it as a string similar to the "Resource ID #3", so it is true.
This "Resource ID #3" is like a sign that connects the data you want to manipulate, and when you manipulate it with a function, for example: mysql_fetch_array ($insert), he takes the results from the database to the function to do the argument.