Last MySQL Row Won't Retrieve.
#1

pawn Код:
new escape[24], query[64];
                    mysql_real_escape_string(inputtext, escape);
                    format(query, sizeof(query), "SELECT `id` FROM `accounts` WHERE `PlayerName` = '%s' LIMIT 1", escape);
                    mysql_query(query);
                    mysql_store_result();
                   
                   
                    printf("rows %d", mysql_num_rows());

                    if(mysql_num_rows() > 0)
                    {
This function works, except for the last row in the table. It returns:

Quote:

[18:03:21] mysql error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''Grant_Reacher' at line 1

in the server log. (That is last name in the TABLE.)
Reply
#2

Bigger query?
Reply
#3

I'll try that, but I didn't think it was....

EDIT: Well what do ya know...It worked. Thank you and I wanna slap myself.
Reply
#4

If you count only this "SELECT `id` FROM `accounts` WHERE `PlayerName` = '' " // it's about 52 chars and your query is 64.. and you must count limit and nick (24) too..
Reply
#5

That makes sense! I'm pretty stupid sometimes, I appreciate that.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)