调试出错: rtt = mysql_real_query(con, tmp, strlen(tmp));
#include "MySQLBool.h"
MySQLBool::MySQLBool() { }
MySQLBool::~MySQLBool() { }
bool MySQLBool::operate(char tmp[])
{
int rt = mysql_real_query(con, tmp, strlen(tmp));
if (rt)
{
printf("Error making query: %s !!!\n", mysql_error(con));
return false;
}
else
{
return true;
}
}
bool MySQLBool::checkExist(char tmp[])
{
MYSQL_RES * res1;
MYSQL_ROW row;
int rtt;
rtt = mysql_real_query(con, tmp, strlen(tmp));
if (rtt)
{
printf("Error making query: %s !!!\n", mysql_error(con));
}
res1 = mysql_store_result(con); // 将结果保存在res结构体中
bool isExist = false;
while (row = mysql_fetch_row(res1))
{
isExist = true;
}
mysql_free_result(res1);
return isExist;
}