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));
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));
how to insert multiple rows in mysql using laravel
/* It is really easy to do a bulk insert in Laravel with or without the query builder. You can use the following official approach. */ Entity::upsert([ ['name' => 'Pierre Yem Mback', 'city' => 'Eseka', 'salary' => 10000000], ['name' => 'Dial rock 360', 'city' => 'Yaounde', 'salary' => 20000000], ['name' => 'Ndibou La Menace', 'city' => 'Dakar', 'salary' => 40000000] ], ['name', 'city'], ['salary']);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us