Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of hasan movahed  >  Wallfa Database  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: easy use database
Class: Wallfa Database
Execute common MySQL queries from parameter values
Author: By
Last change:
Date: 2012-05-03 01:26
Size: 1,063 bytes
 

Contents

Class file image Download
<?php 

 
require "database.php";

/**
 * in select database 
 * 
 */
 
$select=new database();
$select=$select->select(array(
         
'select' => '*',
         
'from' => 'pages',
));
$num=mysql_num_rows($select)or mysql_error();
for(
$i=0;$i<$num;$i++){
    
$news_get=mysql_fetch_array($select);
    
    echo 
"
    <ul>
    <li>"
.$news_get['name']."</li>
    </ul>
    "
;
    
}


/**
 * in inser database
 * 
 */
 
$insert= new database();
$insertarr=array(
     
'name'=>'hasan',
     
'body'=>'kha had amam '
);
// pages tab
$insert->insert('pages',$insertarr);


/**
 * in update database 
 * 
 */
 
$update= new database();
$update_array_fild=array(
     
'name'=>'hasan',
     
'body'=>'kha had amam fffff'
);
$update_array_where=array(
     
'id'=>'35',
);
$update->update('pages',$update_array_fild,$update_array_where);



/**
 * 
 * in delet database 
 * 
 */
 
$delete= new database();
$delete_array_where=array(
     
'id'=>'75',
);
$delete->delete('pages',$delete_array_where);


?>