With the addition of all the lines figured out:
<?php // массив записей для добавления в БД: // $array_insert = array("('1','Anna','anna@mail.ru')", // "('2','Oleg','oleg@yandex.ru')", ... ); $query = mysql_query("INSERT INTO `t1` (`id`, `name`, `email`) VALUES ".implode(",", $array_insert), $db); ?> Question:$array_update - an array of records for updating the database.
How to write a similar request for UPDATE multiple records on selective id ? Given that the records can be updated about 10 pieces at a time ...
What should the values of $array_update look like?
Update
I need to make an update as follows: I have a list of unique id and, corresponding to each id , the lines for the update (the data in the lines can be repeated). It is necessary to make an update of all lines in one request, where the id field corresponds to the current id from the list. I read about INSERT ... ON DUPLICATE KEY UPDATE... I do not yet understand how to apply to my situation.