Just a little trick
Nothing too much elaborate! This is a little useful trick to insert a record in a table for each result from a SQL query. It comes in handy for example when you have to manually populate intermediate table, in case of a many-to-many relationship.
Let’s take a basic example. Suppose that you have a list of products in your database and these products are related to a number of online stores.
SELECT * FROM product
---------------
| ID | Name |
---------------
| 1 …