On failure, 'mysql_query()' returns . . . . . . . .
A. 0
B. 1
C. -1
D. a non-zero value
Answer: Option D
Solution (By Examveda Team)
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.
Related Questions on MySQL Miscellaneous
How is communication established with MySQL?
A. SQL
B. Network calls
C. A programming language like C++
D. APIs
Which type of database management system is MySQL?
A. Object-oriented
B. Hierarchical
C. Relational
D. Network
Join The Discussion