PHP Classes

File: examples/insert.php

Recommend this page to a friend!
  Classes of Mohamed Elbahja   MySQLi Manager   examples/insert.php   Download  
File: examples/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 insert.php
Date: 8 years ago
Size: 351 bytes
 

Contents

Class file image Download
<?php



require 'db_config.php';


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


// insert

$data = array(
   
'title' => 'test title insert',
   
'description' => 'test description insert',
   
'text' => 'test text insert',
    );

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

   
// true
   
echo 'success insert_id = ' . $db->insert_id;

} else {

   
//false
}

$db->close();
?>