Click here to Skip to main content
15,888,007 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have an online MYSQL database with one table and 5 fields.
ID      int
IP      varchar
URL     varchar
UDC     varhar
Status  enum


When I do a query on this, it is returning either 1 row or 0 rows only it seems to be coming back as a ulonglong data type.
What would be causing this, can I get it to return an int?

DS
Posted
Updated 13-May-11 11:57am
v5
Comments
Member 7766180 12-May-11 23:40pm    
IP is an IP address. I have the field length set to 15 but its truncating it. I put in let say 192.168.1.1 and I get 192168 back. This might be the culpurt?
Debojyoti Majumder 13-May-11 1:00am    
can you share your code?
Member 7766180 13-May-11 10:52am    
int main()
{
MYSQL_RES *res_set;
MYSQL* conn;
MYSQL_ROW row;



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'");
int i = 0;
res_set = mysql_store_result(conn);
int numrows = mysql_num_rows(res_set);
{
row = mysql_fetch_row(res_set);
/*If Statement In Here*/
}
{
if (int(row[i]) >= 1)
printf("PASS: %s\n",row[i]);
else
printf("FAIL: %s\n",row[i]);
}

mysql_free_result(res_set);
mysql_close(conn);
system("PAUSE");
}
else
{
cout << "Conn Failed!" <<endl;
system("PAUSE");
return 0;
}
}
Member 7766180 13-May-11 10:58am    
This is the error I'm getting on debug.
warning C4244: 'initializing' : conversion from 'my_ulonglong' to 'int', possible loss of data
Albert Holguin 13-May-11 11:19am    
we went over this... :)

1 solution

You are basically reposting the same question again and again and ignoring all the advice and suggestions that have been offered. If you have some updated information then add it to the original question.
 
Share this answer
 
Comments
Albert Holguin 13-May-11 10:20am    
lol, I like how this guy bothers you so much, yet you just have to post something every time.
Richard MacCutchan 13-May-11 11:00am    
Come on, read through his latest questions, they are all the same thing. And he refuses to go and look at the documentation (which I provided a link for) or to listen to what other contributors have offered in the way of help.
Albert Holguin 13-May-11 11:16am    
This is getting bad, but still... no one's forcing you to read his posts... or me for that matter... :)
Richard MacCutchan 13-May-11 13:04pm    
I am actually trying to help him. The trouble is that you and Kode King are just adding clutter and noise.
Albert Holguin 13-May-11 13:16pm    
I can't hear you over the noise! ...Speak up! :p ...but seriously, you post mean things quite often, look through your answers and lets see what the ratio is from actual solutions to noise that you're adding.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900