What is better to use with MySQL? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: What is better to use with MySQL? (
/showthread.php?tid=176839)
What is better to use with MySQL? -
Scenario - 14.09.2010
I'm debating myself on a couple things, one of which is the method to 'fetch' data from a MySQL database. So which way it best?
1. Fetching each field one by one using
2. Or Using SSCANF and doing something like this?
pawn Код:
mysql_fetch_row(Query, "|");
sscanf(Query, "e<p<|>ds[23]s[30]ddfffdddddddddddd>", PlayerStatistics[playerid]);
Re: What is better to use with MySQL? - [L3th4l] - 14.09.2010
i like the sscanf way
Re: What is better to use with MySQL? -
Scenario - 14.09.2010
Quote:
Originally Posted by [L3th4l]
i like the sscanf way
|
I like that way as well, especially since its a lot faster to script in.
Re: What is better to use with MySQL? -
mick88 - 15.09.2010
sscanf is way more efficient. Fetch_field will always return a string afaik so it's more code if you need integers or floats. I always use sscanf unless i need to acquire full sentences like player's title or greeting message - it's hard to predict what characters they will use so i cant sscanf that. Also the sscanf method i just cleaner.
Re: What is better to use with MySQL? -
Scenario - 15.09.2010
Quote:
Originally Posted by mick88
sscanf is way more efficient. Fetch_field will always return a string afaik so it's more code if you need integers or floats. I always use sscanf unless i need to acquire full sentences like player's title or greeting message - it's hard to predict what characters they will use so i cant sscanf that. Also the sscanf method i just cleaner.
|
Okay, so SSCANF is probably the way to go. Thank you, Mick.
Re: What is better to use with MySQL? -
Cameltoe - 15.09.2010
Quote:
Originally Posted by RealCop228
Okay, so SSCANF is probably the way to go. Thank you, Mick.
|
Do a tick test
Re: What is better to use with MySQL? -
playbox12 - 15.09.2010
I think I've told you the anwser on msn already, like a hundred times