Answers for "php multiple create row"

PHP
1

how to bulk insert array into sql php

$sql = array(); 
foreach( $data as $row ) {
    $sql[] = '("'.mysql_real_escape_string($row['text']).'", '.$row['category_id'].')';
}
mysql_query('INSERT INTO table (text, category) VALUES '.implode(',', $sql));
Posted by: Guest on March-11-2020

Code answers related to "php multiple create row"

Browse Popular Code Answers by Language