What is the best way to access a specific field in C? Its really easy in
PHP...

PHP
-------
$res = mysql_real_query($mysql,"SELECT col1, col2 FROM table");
while($row = mysql_fetch_row($res)) {
    print $row['col1'];
    print $row['col2'];
}

Is the only way/best way to do the above in C by using a nested for-loop?
Ex:

fields = mysql_fetch_fields(res);
while((row=mysql_fetch_row(res)) {
    for(x=0;x<numFields;x++) {
        sprintf(output, "Column name: %s  Column Value: %s\n",
fields[x].name, row[x]);
    }
}

Seems painful and extra-loopy to do it in C. Is there a better way?

Thanks,
Matthew


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to