/ Published in: PHP
URL: http://www.hiteshagrawal.com/mysql/mysql-batch-insert-using-php
Expand |
Embed | Plain Text
< ? $batchconnection = new mysqli($dbHost, $dbUser, $dbPass, $dbName); if ($batchconnection->connect_error) { echo "Error Occurred While Connection To DataBase"; } $sqlStatements = "insert into test(name) values('Hitesh');insert into test(name) values('Agrawal');insert into test(name) values('Hello');insert into test(name) values('World')"; $sqlResult = $batchconnection->multi_query($sqlStatements); if($sqlResult == true) { echo "Successfully Inserted Records"; } else { echo "Some Error Occured While Inserting Records"; } ?>
You need to login to post a comment.
