?
What returns a string containing an error message?
Answer & Solution
Correct Answer:
Option
A
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.
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.
Join the Discussion
Login to post a comment or share your explanation.
Login