File: example.php

Recommend this page to a friend!
  Classes of Kabir Hossain  >  DB Manager  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example script
Class: DB Manager
Execute common SQL queries to a MySQL database
Author: By
Last change:
Date: 3 years ago
Size: 901 bytes


Class file image Download
$db = new Database('localhost','root','','db_example');
//insert example
$data = array(
'name' => 'Demo Insert',
'role' => 'Editor'
//for getting insert id
        //echo $db->insertData($table='users',$data)->insertId();
    //select example
$select_data = $db->selectData($table='users', $select='id,name,role', $where=null, $or_where=null, $orderby='id', $limit=10, $offset=null);
//update example
$data = array(
'name' => 'Demo Update',
'role' => 'Editor'
$where = 'id=4';// using string
        //$where = array('id'=>4);//using array

//delete example
$where = array('id'=>4,'status'=>0);//using array
        //$where = 'id=5 AND status=0';// using string

For more information send a message to info at phpclasses dot org.