Column 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)
+--- Thread: Column mysql (
/showthread.php?tid=568264)
Column mysql -
qmnty - 21.03.2015
Where is better way to do this?
Column like this?
Code 1:
pawn Code:
mysql_get_field("vModel", szFile);
sscanf(szFile, "p<|>ddd", vehicleInfo[extraid][0][vModel], vehicleInfo[extraid][1][vModel], vehicleInfo[extraid][2][vModel]);
Or
this?
Code 2:
pawn Code:
mysql_get_field("vModel1", szFile);
vehicleInfo[extraid][0][vModel] = strval(szFile);
mysql_get_field("vModel2", szFile);
vehicleInfo[extraid][1][vModel] = strval(szFile);
mysql_get_field("vModel3", szFile);
vehicleInfo[extraid][2][vModel] = strval(szFile);
but is that make load the data in code 2 is much longer than code 1?
Thanks...
Re: Column mysql -
mirou123 - 21.03.2015
The first one is better IMHO for the simple reasons that it's shorter and you won't need to create a shitload of columns in your DB
Re: Column mysql -
Vince - 21.03.2015
Neither. You update your plugin and use cache_get_row_int.
Re: Column mysql -
mirou123 - 21.03.2015
Quote:
Originally Posted by Vince
Neither. You update your plugin and use cache_get_row_int.
|
Actually if he updates his plugin it would be better to do something like the first code, using cahce_ger_row. and then using sscanf for the reasons I mentioned in my first post.