If the "bulk" data you have is dynamic and comes from PHP (you still marked it), the query will look something like this:
INSERT INTO `foo` (id, bar) VALUES (1, 'pineapple'), (2, 'asian pear'), (5, 'peach') ON DUPLICATE KEY UPDATE bar = VALUES(bar);
and PHP to generate this from an existing array (assuming the array has the format:
$array = ( somevalues_key => othervalues_value );
) will look something like this (by no means the best (does not apply to escaping or disinfecting values, for example), just a quick example):
$pairs = array(); foreach ($array as $key => $value) { $pairs[] = "($key, '$value')"; } $query = "INSERT INTO `foo` (id, bar) VALUES " . implode(', ', $pairs) . " ON DUPLICATE KEY UPDATE bar = VALUES(bar)";
Davis source share