List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:October 26 1999 1:57am
Subject:Re: Documentation suggestion
View as plain text  
At 5:24 PM -0500 10/25/99, sasha@stripped wrote:
>mysqlclient C function mysql_fetch_row() has the following feature that
>I do not remember being documented:
>If the corresponding query return NULL for the i-th (0-based) column in
>select and you
> do row = mysql_fetch_row(res);
>row[i] would be == NULL
>I guess Monty thought this was obvious as it should be (we have to
>distinguish between the string "NULL" and the actual NULL value), but it
>was not to me for some reason, and I had just spent 15 minutes trying to
>understand why my code was getting the notorious SIGSEGV.
>Monty, I think this would be good to mention in the manual, if it is not
>already there.

It's already there:

The lengths of the field values in the row may be obtained by calling
@code{mysql_fetch_lengths()}.  Empty fields and fields containing
@code{NULL} both have length 0; you can distinguish these by checking
the pointer for the field value.  If the pointer is @code{NULL}, the field
is @code{NULL}; otherwise the field is empty.

Paul DuBois, paul@stripped
Mysql on AlphaJeff Beley25 Oct
  • Documentation suggestionsasha26 Oct
    • Re: Documentation suggestionPaul DuBois26 Oct
  • Mysql on AlphaMichael Widenius13 Nov