开发者

MySQL Is This Code Needed?

开发者 https://www.devze.com 2023-04-10 18:06 出处:网络
I wrote some code a whie back and now I cam\'t remeber why I placed a line in.Can anyone look at this and let me know if what this line does or if I even need it.Memory is not what it use to be! It\'s

I wrote some code a whie back and now I cam't remeber why I placed a line in. Can anyone look at this and let me know if what this line does or if I even need it. Memory is not what it use to be! It's this line. my_ulonglong numrows = mysql_num_rows(res_set);

Heres the code....

(mysql_real_connect(conn,"gxxxx","gxxxx","gxxxx","gxxxx",0,NULL,0) !=0);
char queryString[1024];
sprintf(queryString, "SELECT COUNT(*) FROM tblURLIP WHERE IP = '%s' AND IPStatus = '1' AND IPType = '3' AND IPMax ='0'",ipSrc == NULL ? "0" : ipSrc);
mysql_query(conn, queryString);
my_ulonglong i = 0;
res_set = mysql_store_result(co开发者_StackOverflow中文版nn);

// This is the questionable line
my_ulonglong numrows = mysql_num_rows(res_set);

LEGIT = mysql_fetch_row(res_set);
mysql_free_result(res_set);
    if (atoi(LEGIT[i]) == 1).....

Thank You


Is this a trick question? I ask because if you took a look at the MySQL docs you'd see right away that you need that line of code. After it executes, numrows holds the number of rows that MySQL returned to you when you called mysql_store_result(conn).

0

精彩评论

暂无评论...
验证码 换一张
取 消