PHP Classes

File: examples/update_delete.php

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

Contents

Class file image Download
<?php 

require 'db_config.php';

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

$data = array(

    'title' => 'update title',
    'description' => 'update desc',
    'text'  => 'update text'
);


if ($db->update('example_table', $data, 'WHERE id=1')) {

    // true 
    echo 'updated';
    
} else {

    // false 

}



/**
if ($db->delete('example_table', 'WHERE id=2')) {

    //true 
    echo 'deleted';
    
} else {

    //false
}
**/


$db->close();

?>