MYSQL

I'm running a query off a very small MYSQL db. The query returns either "1" if the record is there or "0" if it is not. From there I have an if statement to print or do another action. This is the problem, I'm getting the "1" or "0" but I think the if statement isn't reconizing the data type. Here is my code. Any help is appreciated.

int main()
{
MYSQL_RES *res_set;
MYSQL* conn;
MYSQL_ROW RED;

conn = mysql_init(NULL);
if (mysql_real_connect(conn,"urlock.db.5513143.hostedresource.com","VendorCheck","Reader1234","urlock",0,NULL,0) !=0)
{
mysql_query(conn,"SELECT COUNT(*) FROM tblURL WHERE IP = '192.168.1.33' AND Status = 'Active'");
my_ulonglong i = 0;
res_set = mysql_store_result(conn);
my_ulonglong numrows = mysql_num_rows(res_set);

RED = mysql_fetch_row(res_set);

if (my_ulonglong (RED[i]) >= (my_ulonglong)1)
printf("PASS: %s\n",RED[i]);
else
printf("FAIL: %s\n",RED[i]);
mysql_free_result(res_set);
mysql_close(conn);
system("PAUSE");
}
else
{
cout << "Conn Failed!" <<endl;
system("PAUSE");
return 0;
}
}
Topic archived. No new replies allowed.