SA-MP Forums Archive
a lil mysql error :X - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: a lil mysql error :X (/showthread.php?tid=69456)



a lil mysql error :X - Think - 18.03.2009

[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?


Re: a lil mysql error :X - MenaceX^ - 18.03.2009

'Gangstah' is?


Re: a lil mysql error :X - Think - 18.03.2009

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


Re: a lil mysql error :X - MenaceX^ - 18.03.2009

Is he registered?


Re: a lil mysql error :X - Think - 18.03.2009

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




Re: a lil mysql error :X - MenaceX^ - 18.03.2009

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..


Re: a lil mysql error :X - Think - 18.03.2009

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


Re: a lil mysql error :X - MenaceX^ - 18.03.2009

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)


Re: a lil mysql error :X - Think - 18.03.2009

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


Re: a lil mysql error :X - Jack_Fox - 18.03.2009

Just put user_id on auto_increcement and then use INSERT