Problem with loading from mysql
#1

Hello, i have this code:

Код:
public LoadCars()
{
	new
	    sql[256],
	    Data[128]
	;
	format(sql, sizeof(sql), "SELECT * FROM `cars`");
	mysql_query(sql);
	new load = 0;
	mysql_store_result();
	while(mysql_retrieve_row())
	{
	    mysql_fetch_field_row(Data, "Price"); CarInfo[load][Price] = strval(Data);
            ....
	    load++;
	}
	printf("Loaded %d cars", load);
}
In debug file everything is Ok, price is '500000', but when i use ingame command, which includes:

Код:
format( string, sizeof( string ), "Car Price: %d", CarInfo[GetPlayerVehicleID(playerid)][Price]);
SendClientMessage( playerid, -1, string );
Then the price is '0'

So, with one world, stats what i load from mysql is not in enum's.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)