SA-MP Forums Archive
How to load data from mysql? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: How to load data from mysql? (/showthread.php?tid=542663)



How to load data from mysql? - Metharon - 21.10.2014

Hello , my problem is i can't load from db a int..
Код:
stock IncarcaStatistica()
{
	new Cache: Result = mysql_query( SQL, "SELECT * FROM `statistica`" ), Get[ 2 ];
	cache_get_data( Get[ 0 ], Get[ 1 ], SQL );
	new string[256];
	for( new id; id < Get[ 0 ] ; id++ )
    {
		Rata = cache_get_field_content_int( id, "Rata", SQL );
	}
    cache_delete( Result );
}
My db it looks like this

http://i.imgur.com/91grHC1.png
http://i.imgur.com/HlmkkN1.png
I tried to load it from database but instead of 5 , it comes 2 ... can somebody explain me how i load the correct int ? and how can i load & save into the database a player name .. and also a ip ?