SA-MP Forums Archive
What better? - 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: What better? (/showthread.php?tid=445884)



What better? - audriuxxx - 23.06.2013

What better use in loading, sscanf or mysql_fetch_field_row ?


Re: What better? - Admigo - 23.06.2013

Quote:
Originally Posted by audriuxxx
Посмотреть сообщение
What better use in loading, sscanf or mysql_fetch_field_row ?
I should use sscanf.
Example:
pawn Код:
if(sscanf(resultline, "p<|>ds[25]s[25]d",
    PlayerInfo[extraid][pVariable1],
    PlayerInfo[extraid][pString1],
    PlayerInfo[extraid][pString2],
    PlayerInfo[extraid][pVariable2],))
    {
        mysql_free_result();
        return 1;
    }



Re: What better? - audriuxxx - 23.06.2013

But, i need load a lot of information and i need to do a lot of sscanf.


Re: What better? - Admigo - 23.06.2013

Quote:
Originally Posted by audriuxxx
Посмотреть сообщение
But, i need load a lot of information and i need to do a lot of sscanf.
I also have much stuff to load. Atm i have like 3x loadplayer:P


Re: What better? - audriuxxx - 23.06.2013

But how need to use

mysql_fetch_field_row ?

And i very need answer... Just in map construction , i build object 996, but when i upload it into my server, rotation is different. It's map construction bug?


Re: What better? - Vince - 23.06.2013

Let me start by saying that fetch_field_row is twice as slow as fetch_field. Most of the time you know the order of the fields so you don't need any useless string comparisons at all. Just use the field index. I don't know how fetch_field(_row) relates to sscanf in terms of speed, though.


Re: What better? - audriuxxx - 23.06.2013

I don't care slower or what. How use fetch_field_row in loading?>


Re: What better? - Vince - 23.06.2013

Quote:
Originally Posted by audriuxxx
Посмотреть сообщение
I don't care slower or what. How use fetch_field_row in loading?>
Then why did you open this topic in the first place? That doesn't make sense.


Re: What better? - audriuxxx - 23.06.2013

Because sscanf i need to use about 15 times in loading, because a lot of stuff. I think with fetch i just need use 1 store_result.