MySQL Dynamic system problem [Loading] - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL Dynamic system problem [Loading] (
/showthread.php?tid=439217)
MySQL Dynamic system problem [Loading] -
zT KiNgKoNg - 24.05.2013
Hey guys, When i load up my server on my local computer i'm trying to load all the textlables by id from the database
it prints that it loaded ID: 1 and 2 but when i go into the game the texttable hasn't been created, The code i've made is below if anyone can help me solve this it would be great.
pawn Код:
stock LoadDynamicTextLables()
{
format(Query, sizeof(Query), "SELECT * FROM `DynamicATMS`");
mysql_query(Query);
mysql_store_result();
new AtmID,TextRow1[100],TextRow2[100], Float:A_X, Float:A_Y, Float:A_Z,string[300];
new Count = 0,Fetched[150];
while(mysql_fetch_row_format(Query,"|"))
{
sscanf(Fetched, "p<|>ds[100]s[100]fff", AtmID, TextRow1, TextRow2, A_X, A_Y, A_Z);
format(string,sizeof(string),"T1: %s\nT2: %d", TextRow1,TextRow2);
Create3DTextLabel(string, 0xFFFFFF, A_X, A_Y, A_Z, 20.0, 0, 0);
Count ++;
printf("Dynamic Lable Created [ID: %d]", Count);
}
return 1;
}
Re: MySQL Dynamic system problem [Loading] -
Joe Staff - 24.05.2013
I believe it's because you're not actually writing anything to the variable 'Fetched', but instead you're writing to 'Query' with the function 'mysql_fecth_row_format'.
pawn Код:
while(mysql_fetch_row_format(Fetched,"|"))