PHP Classes

File: examples/multi_insert.php

Recommend this page to a friend!
  Classes of Mohamed Elbahja   MySQLi Manager   examples/multi_insert.php   Download  
File: examples/multi_insert.php
Role: Example script
Content type: text/plain
Description: Example script
Class: MySQLi Manager
Execute MySQL queries from parameters using MySQLi
Author: By
Last change: Update multi_insert.php
Date: 7 years ago
Size: 511 bytes
 

Contents

Class file image Download
<?php

require 'db_config.php';

/* Connect DB */
$db->conn();

$data = array(

   
'insert_1' => array(
         
'title' => 'test title',
         
'description' => 'test description',
         
'text' => 'test text',
        ),
   
'insert_2' => array(
         
'title' => 'test title 2',
         
'description' => 'test description 2',
         
'text' => 'test text 2',
    ),
  
  
// ......

);


if(
$db->multi_insert('example_table', $data)) {

   
// true
    //
   
print_r($db->insert_ids);

}else {

    echo
'false';
}

$db->close();
?>