This is the 3rd incorrect answer out of 6 replies to this question. It
sure is a good thing we have a manual! Yes, you can insert multiple
rows with one INSERT statement. You just have to get the correct
syntax. It's
INSERT [LOW_PRIORITY | DELAYED] [IGNORE]
[INTO] tbl_name [(col_name,...)]
VALUES (expression,...),(...),...
See http://www.mysql.com/doc/I/N/INSERT.html
Michael
On Mon, 25 Feb 2002, daniel wrote:
> o
> i don't think you can
> you'd just have to post two separate insert statments
> you can run them both at the same time if you like though
>
> INSERT INTO table (booknum, isbn, title) values ('001', '1-56592-434-7',
> 'MySQL & mSQL');
> INSERT INTO table (booknum, isbn, title) values ('002', '1-56592-257-3',
> 'Mastering Regular Expressions');
>
> the only other way to do it would be to
> import the data from another database like this:
> INSERT INTO table [ (coloumn...) ] SELECT ...
>
> OR
>
> use a LOAD DATA and import a text file.
>
> hope that helps
>
>
> ----- Original Message -----
> From: "Bob Rea" <[EMAIL PROTECTED]>
> To: "daniel" <[EMAIL PROTECTED]>
> Sent: Monday, February 25, 2002 4:40 PM
> Subject: Re: Beginner needs help
>
>
> > On Monday 25 February 2002 03:51 pm, you wrote:
> > > my $0.02:
> > >
> > > insert into TABLE (booknum, isbn, title) values ('001',
> > > '1-56592-434-7', 'MySQL & mSQL');
> > >
> > > you want to keep all your field names on the left of
> > > values and all your data on the right. only two sets of
> > > brackets "()".
> >
> > But I'm trying to insert *two* sets of values in the same
> > insert statement. What am I doing wrong?
> >
> > --
> > Bob Rea
> >
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php