Mysql Problem
#1

hello, I am converting my server from Dini to MYSQL and i use the plugin of StrickenKid...
and this is my Query for loading data.

Код:
public OnPlayerLogin(playerid,password[])
{
	    new string[300];
	    format(string, sizeof(string), "SELECT * FROM `utenti` WHERE (`Nick` = '%s' AND `Password` = '%s')", PlayerName(playerid), password);
		mysql_query(string);
		mysql_store_result();
		if(mysql_num_rows() != 0)
		{
			while(mysql_fetch_row(string, "|"))
			{
     				sscanf(string, "p<|>dddddddddddddddddddd",
	 				PlayerInfo[playerid][pLevel],
		 			PlayerInfo[playerid][pAdmin],
		 			PlayerInfo[playerid][pLottoNr],
		 			PlayerInfo[playerid][pPAntidolorifica],
		 			PlayerInfo[playerid][pPAntidroga],
		 			PlayerInfo[playerid][pPRigenerazione],
		 			PlayerInfo[playerid][pDonateRank],
		 			PlayerInfo[playerid][pRegistered],
		 			PlayerInfo[playerid][pSex],
		 			PlayerInfo[playerid][pInvWeapon],
 					PlayerInfo[playerid][pInvAmmo],
		 			PlayerInfo[playerid][pOrologio],
		 			PlayerInfo[playerid][pZaino],
		 			PlayerInfo[playerid][pCorde],
	 				PlayerInfo[playerid][pWalkietalkie],
		 			PlayerInfo[playerid][pBenda],
		 			PlayerInfo[playerid][pTrafficoCell],
		 			PlayerInfo[playerid][pSigarette],
		 			PlayerInfo[playerid][pAccendino],
		 			PlayerInfo[playerid][pMaschera]);
		 			
			}
			mysql_free_result();
		}
}
the problem is that the sscanf string load 23 variables at one time and I need to load 139 variables! how can I do?
Reply
#2

You fetching data to "string" which has size of only 300 cells. Try more, like 512 or 1024. If it isn't enough, you can try make two or more queries.
Reply
#3

@Quis thx!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)