Go to the first, previous, next, last section, table of contents.


Why is it that after mysql_query() returns success, mysql_store_result() sometimes returns NULL?

It means one of the following:

  1. Malloc failure.
  2. The data couldn't be read (Error on connection).
  3. The statement was a statement which never returns data (INSERT or UPDATE or DELETE).

You can always check if the statement should have given a result by checking that mysql_num_fields(MYSQL *) isn't 0. If this is 0 the last query was a statement that does not return values. For example a INSERT or a DELETE.

You have got an error if mysql_error(MYSQL *) isn't empty!


Go to the first, previous, next, last section, table of contents.