SA-MP Forums Archive
a query in 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: a query in MySQL (/showthread.php?tid=355090)



a query in MySQL - jessejanssen - 28.06.2012

Hey,

I am wondering if there is an easier way to input 500 rows into a table then doing ( Not in Pawno, but really in MySQL. ):

Код:
INSERT INTO `table`(id) VALUES(0);
INSERT INTO `table`(id) VALUES(1);
INSERT INTO `table`(id) VALUES(2);
.......
INSERT INTO `table`(id) VALUES(499);
I hope someone here can tell me, thank you in advance!

Best regards,
Jesse

EDIT:
I already found the INSERT INTO `table`(id) VALUES(0),(1),(2),.....,(499); way but that's also not exactly what I need. Just as in pawno you'd have "for(new i = 0; i < 499; i++)" so you can insert everything with just one action. That's what I need, I guess the story is a bit messy but I hope you get what I mean :P


Re: a query in MySQL - Kwarde - 29.06.2012

Just ******d a bit. Here are 2 pages:

http://dev.mysql.com/doc/refman/5.0/...statement.html
http://stackoverflow.com/questions/5...-loop-in-mysql