|
Re: Mysql C API problems: msg#01141db.mysql.general
On Saturday, 29. June 2002 11:15, Hugo Veiga wrote: Hello Hugo, > will this do? > if(!mysql_query(myData, query) > { > results = mysql_store_results(myData); > - if(mysql_num_rows() == 0) + if (!mysql_num_rows(results)) > { > //action; > } > } with the above correction it should work :) > will this do? > row = mysql_fetch_row( results ); > > if(row[0]!=NULL) > { > tempo=_registo[0]->decimals; //?!??!?!? > //other actions here > }//if > The values in row are always represented as strings, so you have to use atoi, atol, atof depends on the type, to convert it: if ((row = mysql_fetch_row(results)) != NULL) { tempo = atoi(row[0]); } Regards Georg mysql, query --------------------------------------------------------------------- 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 <mysql-thread113390@xxxxxxxxxxxxxxx> To unsubscribe, e-mail <mysql-unsubscribe-gcdmg-mysql=m.gmane.org@xxxxxxxxxxxxxxx> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: Mysql C API problems: 01141, Dean Harding |
|---|---|
| Next by Date: | Re: Hidden rows in table.: 01141, Mikhail Entaltsev |
| Previous by Thread: | RE: Mysql C API problemsi: 01141, Dean Harding |
| Next by Thread: | Hidden rows in table.: 01141, Jonas Olofsson |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |