Entry
Does mysql_query return 1 or 0 on success?
Jul 9th, 2004 12:42
Philip Olson, Alexander Berkman, Guest, http://www.php.net/mysql-query
On failure mysql_query() returns boolean false. What mysql_query()
returns on success depends on the type of query.
From the PHP manual: http://www.php.net/mysql-query
"Only for SELECT,SHOW,EXPLAIN or DESCRIBE statements mysql_query()
returns a resource identifier or FALSE if the query was not executed
correctly. For other type of SQL statements, mysql_query() returns TRUE
on success and FALSE on error. A non-FALSE return value means that the
query was legal and could be executed by the server. It does not
indicate anything about the number of rows affected or returned. It is
perfectly possible for a query to succeed but affect no rows or return
no rows."
If mysql_query() fails consider using mysql_error() to find the error.