It is possible for mysql_store_result()
to
return NULL
following a successful call to
mysql_query()
. When this happens, it means
one of the following conditions occurred:
There was a malloc()
failure (for
example, if the result set was too large).
The data couldn't be read (an error occurred on the connection).
The query returned no data (for example, it was an
INSERT
, UPDATE
, or
DELETE
).
You can always check whether the statement should have
produced a non-empty result by calling
mysql_field_count()
. If
mysql_field_count()
returns zero, the
result is empty and the last query was a statement that does
not return values (for example, an INSERT
or a DELETE
). If
mysql_field_count()
returns a non-zero
value, the statement should have produced a non-empty result.
See the description of the
mysql_field_count()
function for an
example.
You can test for an error by calling
mysql_error()
or
mysql_errno()
.
Ésta es una traducción del manual de referencia de MySQL, que puede encontrarse en dev.mysql.com. El manual de referencia original de MySQL está escrito en inglés, y esta traducción no necesariamente está tan actualizada como la versión original. Para cualquier sugerencia sobre la traducción y para señalar errores de cualquier tipo, no dude en dirigirse a mysql-es@vespito.com.