MySQL : Insert Exactly Same Data Multiple Rows Without PHP Loop

Posted by Robert Hanson on Stack Overflow See other posts from Stack Overflow or by Robert Hanson
Published on 2012-09-27T15:27:28Z Indexed on 2012/09/27 15:37 UTC
Read the original article Hit count: 165

Filed under:
|

I need to insert same data to my MySQL table without having PHP loop. The reason why I'm doing this is that because I have a column with Auto_Increment feature and that column associates with other table.

So, I just need to insert some exactly same data and it's multiple rows (dynamic) but by using single INSERT syntax below :

INSERT INTO outbox_multipart (TextDecoded) VALUES ('$SMSMessage')

how to have this single INSERT syntax, but produce n number of rows?

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql