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 , 'corkdjs@gmail.com', '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... email1@hotmail.com email2@hotmail.com email3@hotmail.com etc is there any quick way of doing it besides writhing out a different query for each email address? Quote 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 , 'corkdjs@gmail.com', 'Hi guys.', '', 'http://munsterweddingdjs.com/images/weddings-in-east-cork.jpg', '0'), (NULL , 'email2@gmail.com', 'Hi guys.', '', 'http://munsterweddingdjs.com/images/weddings-in-east-cork.jpg', '0'), (NULL , 'email3@gmail.com', 'Hi guys.', '', 'http://munsterweddingdjs.com/images/weddings-in-east-cork.jpg', '0'); Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.