Creating object from MySQL [+rep?]
#6

Quote:
Originally Posted by Vince
Посмотреть сообщение
mysql_fetch_field_row is incredibly slow, compared to just fetching the whole row at once.

Just make an enumerator:
pawn Код:
enum e_OjbectData
{
    model,
    Float:Xpos,
    Float:Ypos,
    Float:Zpos,
    Float:RX,
    Float:RY,
    Float:RZ,
    MapName[128],
    Float:DrawDist,
    ObjectID
}
Then:
pawn Код:
new
    tempMapData[e_ObjectData];

while(mysql_fetch_row_format(query,"|"))
{
    sscanf(query, "p<|>e<dffffffs[128]fd>", tempMapData);
    CreateObject(tempMapData[model], tempMapData[Xpos], tempMapData[Ypos], tempMapData[Zpos], tempMapData[RX], tempMapData[RY], tempMapData[RZ], tempMapData[DrawDist]);
}
Oh great ! It works ! And i also forgot to mysql_debug(1); that helped also ^^
Reply


Messages In This Thread
Creating object from MySQL [+rep?] - by Michael@Belgium - 11.03.2012, 10:55
Re: Creating object from MySQL [+rep?] - by Shabi RoxX - 11.03.2012, 11:06
Re: Creating object from MySQL [+rep?] - by Michael@Belgium - 11.03.2012, 11:35
Re: Creating object from MySQL [+rep?] - by Shabi RoxX - 11.03.2012, 11:39
Re: Creating object from MySQL [+rep?] - by Vince - 11.03.2012, 12:16
Re: Creating object from MySQL [+rep?] - by Michael@Belgium - 11.03.2012, 12:50
Re: Creating object from MySQL [+rep?] - by Michael@Belgium - 15.03.2012, 16:30
Re: Creating object from MySQL [+rep?] - by iPLEOMAX - 15.03.2012, 16:36
Re: Creating object from MySQL [+rep?] - by SimonItaly - 15.03.2012, 16:40
Re: Creating object from MySQL [+rep?] - by Michael@Belgium - 15.03.2012, 16:42

Forum Jump:


Users browsing this thread: 1 Guest(s)