Jump to content

SQL query to insert muliple records with different email address


kevinkhan

Recommended Posts

Hi guys.

 

I have the following query

 

INSERT INTO `cork_wall`.`Classified` (
`id` ,
`user` ,
`description` ,
`link` ,
`img1` ,
`published`
)
VALUES (
NULL , '[email protected]', 'Hi guys.', '', 'http://munsterweddingdjs.com/images/weddings-in-east-cork.jpg', '0'
);

 

how do i insert the same record multiple times but changing the email address each time to the following emails...

 

[email protected]

[email protected]

[email protected] etc

 

is there any quick way of doing it besides writhing out a different query for each email address?

just enclose the values with brackets and seperate with a comma

INSERT INTO `cork_wall`.`Classified` (
`id` ,
`user` ,
`description` ,
`link` ,
`img1` ,
`published`
)
VALUES (NULL , '[email protected]', 'Hi guys.', '', 'http://munsterweddingdjs.com/images/weddings-in-east-cork.jpg', '0'),
(NULL , '[email protected]', 'Hi guys.', '', 'http://munsterweddingdjs.com/images/weddings-in-east-cork.jpg', '0'),
(NULL , '[email protected]', 'Hi guys.', '', 'http://munsterweddingdjs.com/images/weddings-in-east-cork.jpg', '0');

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.