Mysql database - 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)
+--- Thread: Mysql database (
/showthread.php?tid=428301)
Mysql database -
jop9888 - 05.04.2013
hey all,
so i was trying to set up my database, when i encountered some problems..
pawn Код:
SendClientMessage(playerid,COLOR_RED, "Load player called");
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new Row[1024], Field[44][255], Query[256+128];
SendClientMessage(playerid,COLOR_RED, "Query started");
format(Query, sizeof(Query), "SELECT * FROM `users` WHERE `username` = '%s'", name);
mysql_query(Query);
SendClientMessage(playerid,COLOR_RED, "Query succesfully started");
mysql_store_result();
if(mysql_num_rows() == 1)
{
well, i only get the message "Load player called"
the message "Query started" doesn't even show..
it seems to wrong is this line already:
pawn Код:
new Row[1024], Field[44][255], Query[256+128];
But the compiler doesn't give any errors, can someone tell me what i'm doing wrong here?
and when i move that line out of the function ( so i make it global )
things work normally!
Thanks in advance,
Jop9888
Re: Mysql database -
Jstylezzz - 05.04.2013
Use [pawn] tags please. And, are you sure the script is connected to the database? Try adding mysql_debug(1); under OnGameModeInit to be able to see the Debug.txt, we can check if it's connected there, or if there are any other problems. Also, have you already created the database and the table? If not, you might want to check some MYSQL tutorials.
Re: Mysql database -
jop9888 - 05.04.2013
Quote:
Originally Posted by Jstylezzz
Use [pawn] tags please. And, are you sure the script is connected to the database? Try adding mysql_debug(1); under OnGameModeInit to be able to see the Debug.txt, we can check if it's connected there, or if there are any other problems. Also, have you already created the database and the table? If not, you might want to check some MYSQL tutorials.
|
the problem is not with the database, as i explained, when i move the problem giving line out of the function and make it global everything works fine.