Doubt 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: Doubt mysql. (
/showthread.php?tid=628692)
Doubt mysql. -
Jose_grana - 13.02.2017
My question is the following:
Suppose I have 200 cars in my database (obviously the gm is mysql). Now suppose I just want to load the ID 50. How can I do it?
Do I have to load 200 cars or is there any way to load only the one I want?
I use the MYSQL R39 plugin.
Sorry for my bad english.
+ Rep to help.
Re: Doubt mysql. -
ISmokezU - 13.02.2017
Код:
mysql_format(mysql, query, sizeof(query), "SELECT * FROM cars WHERE ID = %d LIMIT 1"
Re: Doubt mysql. -
AjaxM - 13.02.2017
It could simply be done with the following query:
PHP код:
SELECT * FROM `vehicles` WHERE `id` = '%d' LIMIT 1
EDIT ;
Smoke was faster than me!