Login   Register  
PHP Classes
elePHPant
Icontem

File: example2.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Osama Salama  >  DBMysqli  >  example2.php  >  Download  
File: example2.php
Role: Example script
Content type: text/plain
Description: example2
Class: DBMysqli
Access MySQL databases with mysql and mysqli
Author: By
Last change:
Date: 2013-03-24 12:04
Size: 943 bytes
 

Contents

Class file image Download
<?php
require_once "Database.php";

$config['default']['Host']="localhost";
$config['default']['UserDb']="root";
$config['default']['PassDb']="";
$config['default']['Dbname']="cms";
$config['default']['Prefix']="";
$config['default']['Charset']="";

/*
choose MYSQL  or MYSQLi 
*/
$DB=Database::getInstance("mysqli",$config);

//insert data=================================
/*
$data=array(
'ID'=>'1',
'name'=>'ali mohammed ali',
'dates'=>'NOW()'
);
$DB->save('table name',$data);
*/


//update=========================================

/*
$data=array(
'name'=>'ali mohammed ali',
'counter'=>'(counter+1)'  //you can use this to increment data in column .
);
$DB->update('table name',$data,"ID='1' and email='tes@te.com' ");
*/


//free sql=============================
/*
$sql="select .......................";
$rs=$DB->query($sql);
foreach($rs as $row){
    echo $row['columnname or index'];
    }
*/
?>