2
I need to go through a json and take 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 several simultaneous php Inserts.
2
I need to go through a json and take 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 several simultaneous php Inserts.
4
Concatene the Inserts with ;
or do INSERT as follows:
INSERT INTO tabela(coluna1, coluna2, coluna3)
VALUES
(valor1, valor2, valor3),
(valor4, valor5, valor6),
(valor7, valor8, valor9) ...
Browser other questions tagged php mysql
You are not signed in. Login or sign up in order to post.
Exactly this answer Silvio Andorinha! :-)
– Marcony Felipe
What I recommend is to do the Insert in multiple lines as @rodrigorigotti commented for the reason that the database processing is much faster.
– Marcelo Diniz
Example of the mysql manual: INSERT INTO tbl_name (a,b,c) VALUES(1,2,3),(4,5,6),(7,8,9);
– Marcelo Diniz