a lil mysql error :X
#1

[15:38:33] DEBUG OnPlayerLogin(0) (lol)
[15:38:33] Error in mysql_query: Unknown column 'Gangstah' in 'where clause'
[15:38:33] Error in mysql_store_result: Unknown column 'Gangstah' in 'where clause'


pawn Код:
format(query, sizeof(query), "SELECT * FROM users WHERE name='%s' AND password='%s'", playername2, string);
    samp_mysql_query(query);
    samp_mysql_store_result();
thats the code wuts wrong?
Reply
#2

'Gangstah' is?
Reply
#3

Quote:
Originally Posted by MenaceX^
'Gangstah' is?
the account name of the person who tested this
Reply
#4

Is he registered?
Reply
#5

Quote:
Originally Posted by MenaceX^
Is he registered?
he is in the database:

Reply
#6

I dunno in your way.
In my codes I have a varieble to check the player registation ID, each registation adds one more ID.
So I can select it like
pawn Код:
format(string,sizeof(string),"SELECT * FROM `users` WHERE `id`='%d'",pInfo[playerid][registeredid]);
samp_mysql_query(string);
I never tried it with names..
Reply
#7

i got those ID's but if i do onplayerlogin i dont know his ID yet do i?
Reply
#8

I guess you didn't define it...
in ONPlayerRegister the player should get an id +1.
Like, you were registered with ID 55. Someone else registers with 56 (+1)
Reply
#9

yes but how would i know his ID if i dont know how to bind it to a variable when joining? ¬¬
Reply
#10

Just put user_id on auto_increcement and then use INSERT
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)