<?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);
?>
|