a query in MySQL
#1

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
Reply
#2

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)