Which of the following use 'NULL' to indicate failure?
mysql_init(), mysql_real_connect()
mysql_init(), mysql_real_connect()
A. 0
B. 1
C. 2
D. 3
Answer: Option C
Solution (By Examveda Team)
This question is about how MySQL functions handle errors.In MySQL, functions often use the special value NULL to signal that something went wrong.
The functions mentioned, mysql_init() and mysql_real_connect(), are used for setting up a connection to a MySQL database.
If either of these functions fails, they will return NULL.
So, the correct answer is None of the above. The question is designed to trick you into thinking about numerical error codes, but MySQL uses NULL to represent errors in these cases.
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