文章详情
时间:2008-06-04 来源:evaspring
#include </usr/local/mysql/include/mysql.h> #include <stdio.h> main() { char host[32]="local"; char db_user[32]="test"; char passwd[32]="123456"; char db[32]="mydb"; MYSQL mysql; MYSQL_RES *res; MYSQL_ROW row; mysql_init(&mysql); mysql_real_connect(&mysql,host,db_user,passwd,db,3306, NULL, 0); mysql_query(&mysql,"select * from table"); res=mysql_use_result(&mysql); while(row=mysql_fetch_row(res)) { printf("%s %s\n",row[0],row[1]); } mysql_close(&mysql); }
辰域智控app
网医联盟app
汇丰汇选App
1970-01-01