Answers for "how to insert multiple rows in mysql using php form"

PHP
0

php bulk insert mysql

$values = array(); 
foreach($data as $row ) {
    $values[] = '('.$row['id'].', "'.mysql_real_escape_string($row['name']).'")';
}
mysql_query('INSERT INTO table (id, name) VALUES '.implode(',', $sql));
Posted by: Guest on October-24-2020

Code answers related to "how to insert multiple rows in mysql using php form"

Browse Popular Code Answers by Language