09.12.2013, 21:42
Here's a sample of loading float using sscanf, make sure you also define your variables with Float:
I suggest you start using cache or orm version.
pawn Код:
new _QuerySize[ 256 ], PlayerName[ 24 ];
GetPlayerName( playerid, PlayerName, sizeof( PlayerName) );
format( _QuerySize, sizeof( _QuerySize ), "SELECT * FROM `you_table_here` WHERE`Username` = '%s'", PlayerName); // formats the query for "mysql_query"
mysql_query( _QuerySize ); // queries the "query" Variable.
mysql_store_result( ); // stores the result from query
if( mysql_num_rows( ) )
while( mysql_fetch_row( _QuerySize ,"|" ) ) // splits the row
{
sscanf( _QuerySize, "p<|>e<ffff>", sInfo[i][sPosX], sInfo[i][sPosY], sInfo[i][sPosZ], sInfo[i][sPosA]); //sscanf separates the data from the variable
}