List:General Discussion« Previous MessageNext Message »
From:Gerald Clark Date:May 30 2002 1:38pm
Subject:Re: Extracting binary data from a row
View as plain text  
All the numeric types are returned as strings.  If you want to convert 
them to numbers, you need
to use scanf or atod type functions.

Michael Flora wrote:

> Hello all, this is my first post to this list.  I am relatively new to 
> MySQL, and my question might be a basic one.
>
> I have a table that contains both character and binary data.  I am 
> reading rows from the table using the function mysql_fetch rows() in a 
> C program.  I can obtain character data all right, but I cannot obtain 
> the values of binary data stored in the table as type DOUBLE.  My code 
> looks like this:
>
> double dnum;
> .
> .
> .
> row = mysql_fetch_rows(result);
>
> dnum = *row[1];     /* The data is stored in the 2nd column of the 
> table */
>
> printf("%10.2f",dnum);
>
> When I execute this I get junk.  I know from inspection that there are 
> good values in the table.  What am I doing wrong?
>
> Thanks for any advice,
> Michael Flora
>
>
>
>


Thread
Extracting binary data from a rowMichael Flora29 May
  • Re: Extracting binary data from a rowGerald Clark30 May