Q1156
On failure, 'mysql_query()' returns . . . . . . . .
A.
0
B.
1
C.
-1
D.
a non-zero value
AnswerAnswer: Option D
Solution
Answer: Option D
Solution:
This question is about how MySQL tells you if a query was successful or not.
The function `mysql_query()` is used to send SQL commands to the database.
When a command runs successfully, it returns a special value.
When something goes wrong, it returns a different value to signal an error.
The answer: Option C (-1).
So, if `mysql_query()` returns -1, it means your query failed.