hello :
i am learning to write my program with c-API of mysql4.0.11a,
it is a very simple program , just do sth as
mysql_query(&mysql,"select name from persons where id = %d")
while after successful query ,i do know how to get the result !
will you please give me some example of program ?
my program:
**********************
......
mysql_init(&mysql);
if (!(sock = mysql_real_connect(&mysql,NULL,0,0,argv[1],0,NULL,0)))
{
...
}
count=atoi(argv[2]);
sprintf(qbuf,SELECT_QUERY,count);
buffer=qbuf;
printf("%s\n",buffer);
if(mysql_query(sock,qbuf))
{
fprintf(stderr,"Query failed:%s\n",mysql_error(sock));
exit(1);
}
if(!(result=mysql_store_result(&mysql)))
{
fprintf(stderr,"Couldn't get result from %s\n",mysql_error(&mysql));
exit(1);
}
printf("%d products select\n",mysql_affected_rows(&mysql));
*** and next ??? :(
********************
thanks a lot!