SA-MP Forums Archive
mysql problem - 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: mysql problem (/showthread.php?tid=216441)



mysql problem - swredder - 25.01.2011

hello, im trying to script a mysql admin script, logging in and registring works but im having some problems with saving and loading the data, i first made a script to load the data to start off

Код:
Loadplayer(playerid)
{
	new name[MAX_PLAYER_NAME];

	// Get the playername
	GetPlayerName(playerid, name, sizeof(name));
 
    new Query[200];

    format(Query, sizeof(Query), "SELECT * FROM `accounts` WHERE `user` = '%s'", name[playerid]); 
    mysql_query(Query);
    mysql_store_result();
	new line[1300];

            if(mysql_fetch_row(line)) 
            {

        			sscanf(line, "e<s[50]s[32]dddddddddddddddddd>",APlayerData[playerid]);


                    mysql_free_result();
               }
	return 1;
}
but, for some reason this isnt working, any1 knows whats wrong?(it doesnt load any data from mysql)


Re: mysql problem - iJumbo - 25.01.2011

put under OnGamemodeInit

pawn Код:
mysql_debug(1);
and try again and u get i nserver floder a file with a debug and check mysql error


Re: mysql problem - swredder - 25.01.2011

thanks, found the problem and fixed it =]