kevinkhan Posted June 7, 2011 Share Posted June 7, 2011 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? Link to comment https://forums.phpfreaks.com/topic/238705-sql-query-to-insert-muliple-records-with-different-email-address/ Share on other sites More sharing options...
joel24 Posted June 8, 2011 Share Posted June 8, 2011 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'); Link to comment https://forums.phpfreaks.com/topic/238705-sql-query-to-insert-muliple-records-with-different-email-address/#findComment-1226821 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.