Action()
{
char chQuery[128];
MYSQL *Mconn;
int result;
//引入mysql动态链接库
lr_load_dll("libmysql.dll");
//建立mysql连接
Mconn=lr_mysql_connect(DBSERVER,DBUSERNAME,DBPASSWORD,DBNAME,atoi(DBPORT));
//设置要执行的SQL语句
sprintf(chQuery,"select email from d_user");
//执行SQL语句
result=lr_mysql_query(Mconn,chQuery);
//判断执行是否成功
if(result==0){
lr_output_message("执行成功");
}
else{lr_output_message("执行失败");
}
//断开mysql连接
lr_mysql_disconnect(Mconn);
return 0;
}