SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 21/03/2015, 12:33 AM   #1
qmnty
Big Clucker
 
Join Date: Dec 2013
Posts: 124
Reputation: 1
Default Column mysql

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...
qmnty is offline   Reply With Quote
Old 21/03/2015, 09:54 AM   #2
mirou123
Huge Clucker
 
Join Date: Jul 2013
Posts: 362
Reputation: 22
Default Re: Column mysql

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
mirou123 is offline   Reply With Quote
Old 21/03/2015, 10:07 AM   #3
Vince
Spam Machine
 
Vince's Avatar
 
Join Date: Sep 2007
Location: Belgium
Posts: 10,067
Reputation: 2660
Default Re: Column mysql

Neither. You update your plugin and use cache_get_row_int.
__________________
Vince is offline   Reply With Quote
Old 21/03/2015, 10:14 AM   #4
mirou123
Huge Clucker
 
Join Date: Jul 2013
Posts: 362
Reputation: 22
Default Re: Column mysql

Quote:
Originally Posted by Vince View Post
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.
mirou123 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL column problem Grumbles Scripting Help 12 16/11/2014 05:37 PM
[HELP] mysql date column [REP+] Luca12 Scripting Help 14 29/07/2014 01:05 PM
MySQL - New value which wasn't in the column before TudvariHUN Scripting Help 3 04/01/2014 01:50 PM
MySQL column question. PaulDinam Scripting Help 3 30/03/2013 09:46 PM
getting the max int from a mysql column The_Gangstas Help Archive 5 28/12/2010 07:22 AM


All times are GMT. The time now is 08:10 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.