Mysql wont get field
#1

pawn Код:
new Query[256],pName[MAX_PLAYER_NAME],MyIP[16];
    GetPlayerIp(playerid,IP[playerid],16);
    GetPlayerName(playerid,pName,24);
    format(Query,sizeof(Query),"SELECT * FROM `users` WHERE username = '%s' LIMIT 1",pName);
    mysql_query(Query);
    mysql_store_result();
    mysql_affected_rows();
    mysql_get_field("IP",MyIP);
    printf("%s = %s", MyIP , IP[playerid]);
PRINT RETURNS "= 192.168.1.2" (the first ip is gone )
Reply
#2

Get mysql_errno() and display it's value
Reply
#3

When i add mysql_errno(); afther the print i dont get anyting in the console
Reply
#4

if(mysql_errno() == 0) print("Query processed!");
returning Query processed!

Im using varchar with lenght 16 and when i print(MyIP); it returns (null)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)