How many 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 asks you to identify how many MySQL functions use NULL to signify an unsuccessful operation.Let's break down the given functions:
mysql_init() initializes a MySQL connection. It returns NULL if there is an error in initialization.
mysql_real_connect() establishes a connection to a MySQL server. It also returns NULL if the connection fails.
Therefore, both functions utilize NULL to indicate failure.
Hence, the correct answer is Option C: 2

Join The Discussion