>>>>> "Scott" == Scott Hess <scott@stripped> writes:
Scott> Manual section 20.4.50 Why is it that after mysql_query() returns success,
Scott> mysql_store_result() sometimes returns NULL?' states:
Scott> "You can always check whether or not the statement should have produced a
Scott> non-empty result by calling mysql_num_fields(). If mysql_num_fields()
Scott> returns zero, the result is empty and the last query was a statement that
Scott> does not return values (for example, an INSERT or a DELETE). If
Scott> mysql_num_fields() returns a non-zero value, the statement should have
Scott> produced a non-empty result. See the description of the mysql_num_fields()
Scott> function for an example."
Scott> I'm unable to reconcile this with the API functions. Since
Scott> mysql_num_fields() accepts a MYSQL_RES parameter, if mysql_store_result()
Scott> returns a NULL MYSQL_RES, then what value would you pass to
Scott> mysql_num_fields() in order to get the zero return?
Scott> Later,
Scott> scott
Hi!
The mysql_num_fields(MYSQL_RES *) should be mysql_field_count(MYSQL *)
In MySQL 3.22 mysql_num_fields is a macro that will work both for the
MYSQL and MYSQL_RES structure.
Starting with MySQL 3.23 and MYSQL 3.22.25 one should use
mysql_field_count instead!
Regards,
Monty