Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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));
 
PREVIOUS NEXT
Tagged: #php #bulk #insert #mysql
ADD COMMENT
Topic
Name
8+8 =