MySQL: Insert multiple records at once
Question by NetLabel | 2012-03-23 at 15:27
I have about 50 to 100 records to be inserted into a table with a PHP script. However, I do not want to call 50 times a new INSERT command after each other, which seems to me a little bit bad for the performace.
There must be a better and also faster way! Does any one of you have a solution?
Related Topics
MySQL: Delete Data from Table - Difference between TRUNCATE, DELETE and DROP
Tutorial | 0 Comments
MySQL: How many records have been found or are affected by my query?
Info | 0 Comments
How to Replace multiple Texts at the same Time
Tutorial | 0 Comments
MySQL: Display search results on multiple pages
Tutorial | 0 Comments
MySQL: Write current Date or Time into Column
Tutorial | 0 Comments
MySQL/PHP: How to retrieve the last INSERT ID
Info | 0 Comments
MySQL: Regular Expressions in MySQL queries
Info | 0 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
You are right! Calling a hundred times an INSERT in a row makes little sense. The syntax, you are looking for is as follows:
Thus, it is much like a normal INSERT, you can easily attach more records with a comma separated.
2012-03-24 at 20:52