ExamVeda
Login
Home
This question belongs to MySQL MySQL Miscellaneous
MySQL Miscellaneous
?

For failure, mysql_query() returns . . . . . . . .

Answer & Solution
Correct Answer: Option D
This question is asking about how MySQL's `mysql_query()` function behaves when a query fails.

`mysql_query()` is a function used to execute SQL queries in MySQL. It returns a value that tells you whether the query was successful or not.

Here's how it works:

* If the query is successful, `mysql_query()` returns a non-zero value (usually a resource ID). * If the query fails, `mysql_query()` returns `FALSE` (which is equivalent to `0`).

Therefore, the correct answer is Option A: 0.

Important Note:

The `mysql_query()` function is considered deprecated in newer versions of PHP. It's recommended to use the MySQLi or PDO extensions for interacting with MySQL databases instead.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.