Re: mysql problem

From: Fatted (obeseted_at_yahoo.com)
Date: 09/23/04


Date: Thu, 23 Sep 2004 15:47:24 +0200

Alfredo wrote:

<snip>

> Everything works ok until I do
> res = mysql_store_result(conn);
>
> if (res)
>
> Thus, res becomes null. Why?
>

Check out:

http://dev.mysql.com/doc/mysql/en/mysql_store_result.html

<quote>
mysql_store_result() also returns a null pointer if reading of the
result set failed. You can check whether an error occurred by checking
if mysql_error() returns a non-empty string, if mysql_errno() returns
non-zero, or if mysql_field_count() returns zero.

An empty result set is returned if there are no rows returned. (An empty
result set differs from a null pointer as a return value.)
</quote>

Some additional debugging code may be required...



Relevant Pages

  • Re: Converting enums to pointers
    ... > You declare EMPTY to be a null pointer here. ... though it might be nice to use the extern keyword. ...
    (comp.lang.cpp)
  • Re: basic_string ctor
    ... > and a NULL pointer both construct a std::string as empty. ... than likely I'm converting something from a GUI layer to a standard ... as anything but an empty string. ...
    (microsoft.public.vc.stl)
  • Mouse Pointer Becomes 4-Way Arrow and Wont Revert
    ... In WinXP Home SP1, my mouse pointer occasionally becomes a 4-way arrow and ... will not revert to a regular pointer unless I go to the mouse properties ... PCI 1: Empty ... Firewall: Kerio Personal Firewall 2.1.4 ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: futex question
    ... has an entry (lock held) in do_execveand return -EWOULDBLOCK to ... Same if pi_waiters is not empty. ... +#ifdef CONFIG_COMPAT ... Just because the head pointer has been registered does not mean that the list is non-empty. ...
    (Linux-Kernel)
  • Re: What is eq? used for
    ... > efficiently than eqv?, for example, as a simple pointer comparison". ... rationals that happen to be equal. ... booleans, the empty list, pairs, procedures, and non-empty strings ...
    (comp.lang.scheme)