How to do multiple simultaneous inserts with php

2

I need to go through a json and get the values and insert into the bank but I think it would be a bad idea to put an insert inside a loop.

I would like to know how to do multiple simultaneous inserts with php.

    
asked by anonymous 17.02.2014 / 20:36

1 answer

4

Concatenate INSERTs with ; or INSERT as follows:

INSERT INTO tabela(coluna1, coluna2, coluna3)
VALUES
     (valor1, valor2, valor3),
     (valor4, valor5, valor6),
     (valor7, valor8, valor9) ...
    
17.02.2014 / 20:38