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



one. - KessMan - 28.10.2016

It is best to use only one string for all MySQL updates in my GameMode with "tquery"?


Re: one. - AndySedeyn - 28.10.2016

Can you provide an example of what you mean?


Re: one. - KessMan - 28.10.2016

Make a global string. = "new queryUpdate[200];".

System 1 = "mysql_format(SQLCon, queryUpdate, sizeof(queryUpdate), " ... etc "", "mysql_tquery(SQLCon, queryUpdate);"
System 2 = "mysql_format(SQLCon, queryUpdate, sizeof(queryUpdate), " ... etc etc "", "mysql_tquery(SQLCon, queryUpdate);"

All MYSQL updates in my GM.


Re: one. - AndySedeyn - 28.10.2016

Oh. No, that's never a good idea. The more scripts you create, the sooner you'll find yourself creating queries longer than 200 characters. But you'll also find yourself creating a lot of queries much smaller than 50 characters. All of the remaining indices will be wasted space.


Re: one. - SickAttack - 28.10.2016

don't "use only one string for all MySQL updates in my GameMode with "tquery""


Re: one. - KessMan - 28.10.2016

The problem would only be used space used?


Re: one. - Freaksken - 28.10.2016

Quote:
Originally Posted by KessMan
Посмотреть сообщение
The problem would only be used space used?
Read my post on a topic with a similar question here.


Re: one. - AndySedeyn - 28.10.2016

No. If you format the query somewhere and forget about it, it's globally formatted. It's still a global variable! This will lead to long debug sessions trying to find the reason why something is malfunctioning. Moreover, wasting space like that is frowned upon because it's very bad practice.


Re: one. - SickAttack - 28.10.2016

Quote:
Originally Posted by AndySedeyn
Посмотреть сообщение
No. If you format the query somewhere and forget about it, it's globally formatted. It's still a global variable! This will lead to long debug sessions trying to find the reason why something is malfunctioning. Moreover, wasting space like that is frowned upon because it's very bad practice.
It's just not convenient...