Examveda

Which of the following use 'NULL' to indicate failure?
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.

This Question Belongs to MySQL >> MySQL Miscellaneous

Join The Discussion

Related Questions on MySQL Miscellaneous