Need help with mysql update...
#5

Код:
stock LoadGarages()
{
	mysql_tquery(sql_handle, "SELECT * FROM Garages", "OnGarageDataLoad", "");
}

forward OnGarageDataLoad();
public OnGarageDataLoad()
{
    for(new i=0, max = cache_get_row_count(); i < max; ++i)
	{
		Garages[i][EnterX] = cache_get_row_float(i, 1);
		Garages[i][EnterY] = cache_get_row_float(i, 2);
		Garages[i][EnterZ] = cache_get_row_float(i, 3);
		//....
		cache_get_row(i, 10, Garages[i][Owner], sql_handle, MAX_PLAYER_NAME);
		Garages[i][Price] = cache_get_row_int(i, 11);
		//....
		
		//if(Garages[i][Owned]...
	}
	printf("%d Garages loaded from database", cache_get_row_count());
	return 1;
}
For that SaveGarages code, just replace "mysql_query" with "mysql_tquery" (like in function "LoadGarages").
Reply


Messages In This Thread
Need help with mysql update... - by Scrillex - 24.01.2014, 23:36
Re: Need help with mysql update... - by Shetch - 24.01.2014, 23:40
Re: Need help with mysql update... - by Scrillex - 24.01.2014, 23:56
Re: Need help with mysql update... - by Scrillex - 25.01.2014, 12:35
Re: Need help with mysql update... - by maddinat0r - 25.01.2014, 12:57
Re: Need help with mysql update... - by Scrillex - 25.01.2014, 13:07
Re: Need help with mysql update... - by maddinat0r - 25.01.2014, 13:11

Forum Jump:


Users browsing this thread: 1 Guest(s)