Examveda

What returns a string containing an error message?

A. mysql_error()

B. mysql_errno()

C. mysql_sqlstate()

D. mysql_close()

Answer: Option A

Solution (By Examveda Team)

This question asks about a function in MySQL that provides information about errors that occur during database operations.
Let's understand the options:
Option A: mysql_error()
This function returns a string containing the actual error message.
Option B: mysql_errno()
This function returns an integer representing the error number.
Option C: mysql_sqlstate()
This function returns a five-character SQLSTATE error code.
Option D: mysql_close()
This function closes a database connection and doesn't return an error message.
Therefore, the correct answer is Option A: mysql_error() because it specifically returns the error message as a string.

This Question Belongs to MySQL >> MySQL Miscellaneous

Join The Discussion

Related Questions on MySQL Miscellaneous