Vidyalelo
MySQL · Q595

MySQL

Programming · MySQL · question 595

Q595

How many of the following use NULL to indicate failure? mysql_init(), mysql_real_connect()

A.
0
B.
1
C.
2
Answer
D.
3

Answer: Option C

Solution

Answer: Option C
Solution:
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