Q700
Which of the following returns a MySQL-specific numeric code?
A.
mysql_error()
B.
mysql_errno()
AnswerC.
mysql_sqlstate()
D.
mysql_close()
Answer: Option B
Solution
Answer: Option B
Solution:
This question is asking about which function in MySQL gives you a number that specifically tells you what kind of error happened.
Let's break down the options:
Option A: mysql_error() * This function gives you a text description of the error that occurred. It's useful for understanding what went wrong, but it doesn't give you a specific number.
Option B: mysql_errno() * This is the correct answer! This function gives you a numeric code that represents the specific error that occurred. This code can be helpful for troubleshooting and identifying the problem.
Option C: mysql_sqlstate() * This function gives you a SQLSTATE code, which is a standard error code used in SQL databases. It's not specific to MySQL.
Option D: mysql_close() * This function is used to close a MySQL connection and doesn't return an error code.
In summary, the function that returns a MySQL-specific numeric code is mysql_errno().