Inserting multiple similar rows with one form
I wrote a small script which adds info to my database. It only adds one row, but it would be easier if I could add 9 rows at once.
I wrote a small script which adds info to my database. It only adds one row, but it would be easier if I could add 9 rows at once.
ROB posted this at 18:25 — 14th July 2002.
They have: 447 posts
Joined: Oct 1999
INSERT INTO sometable (field1,field2,field3)
VALUES
('firstrow','firstrowdata','morefirstrowdata'),
('secondrow','secondrowdata','moresecondrowdata'),
('thirdrow','thirdrowdata','morethirdrowdata'),
('fourthrow','fourthrowdata','morefourthrowdata')
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.