Re: Best way to access field name in C

2004-10-27 Thread Aftab Jahan Subedar
Hey have you checked thi shttp://www.geocities.com/jahan.geo/mysql_c_by_example.html? Matthew Boehm wrote: 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))

Best way to access field name in C

2004-10-11 Thread Matthew Boehm
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

Re: Best way to access field name in C

2004-10-11 Thread Karam Chand
Hello, In C you dont have named access to the columns as they are returned as an array of char*. The only solution would be to access it using its index value. Like PHP, you have to do mysql_fetch_row() anyway. After that access the row by its index. If you prefer named access and dont mind a

RE: Best way to access field name in C

2004-10-11 Thread Tom Horstmann
Dear Matthew, 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 =

Re: Best way to access field name in C

2004-10-11 Thread Philippe Poelvoorde
Matthew Boehm wrote: What is the best way to access a specific field in C? Its really easy in PHP... http://dev.mysql.com/doc/mysql/en/mysql_fetch_row.html you won't have the hash-table feature offered by PHP, but nothing stop you to do the same. PHP --- $res = mysql_real_query($mysql,SELECT