Michael Flora wrote:

> Hello all, I posted this question yesterday but received no feedback 
> so I decided to ask again.
>
> I am new to MySQL and I am trying to access binary data stored in a 
> MySQL table using a C program.  The table looks like this:
>
>
> date date
> double firstfield
> double secondfield
> double thirdfield
>
> My  C code looks like this:
>
> double first;
> double second;
> .
> .
> .
> row = mysql_fetch_row(result);
> first = *row[1];
> .
> .
> .
> Since a row is supposed to be returned as an array of pointers I 
> should be able to dereference to get the field value, right?  However 
> I get nothing but junk.  What am I doing wrong?
>
> Thanks for any suggestions,
> Michael Flora


Please see http://www.mysql.com/doc/C/_/C_API_datatypes.html

mysql_fetch_row() returns type MYSQL_ROW, which is an array of byte-strings.

You will need to use the C library function atod() to change it into a 
double.

    -Mark




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to