本文介绍了SQL返回错误的结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
此查询始终返回"1",不太确定出什么问题了吗?
谢谢
DS
This query always returns "1", Not quite sure whats wrong?
Thanks
DS
<pre lang="cs">if (mysql_real_connect(conn,"urlock.db.5513143.hostedresource.com","VendorCheck","Reader1234","urlock",0,NULL,0) !=0)
{
legal = mysql_query(conn, "SELECT COUNT(*) FROM tblURL WHERE IP = ''192.168.1.1''");
if( legal != 0 )
{
printf(mysql_error(conn)); return 99;
}
result = mysql_store_result(conn);
printf("Legal: %d\n", mysql_num_rows(result));
mysql_free_result(result);
mysql_close(conn);
推荐答案
printf("Legal: %d\n", mysql_num_rows(result));
这篇关于SQL返回错误的结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!