Login   Register  
PHP Classes
elePHPant
Icontem

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of majid ramzani  >  Keep edit and delete database archive  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: usage
Class: Keep edit and delete database archive
Access tables keeping deleted records archived
Author: By
Last change:
Date: 2012-12-16 15:04
Size: 1,153 bytes
 

Contents

Class file image Download
<?php 

include "KEDA.class.php";

$table="news";
$time=time();
$subject="test".$time;
$content="content of test ".$time;


//to insert row:
$insert=KEDA::Insert($table," (subject,content,date) values('$subject','$content','$time') ");
if(
$insert) echo "Row inserted. \n <br>"; else echo mysql_error()."  \n <br> ";


//to delete
//change it frequently to see result!
$row_id=1;
$delete=KEDA::Delete($table,$row_id);
if(
$delete) echo "Row deleted. \n <br>"; else echo mysql_error()."  \n <br> ";


//to delete
//change it frequently to see result!
$row_id=1;
$subject="test ".$time." edited";
$content="content of test ".$time." edited";

$edit=KEDA::Edit($table,$row_id," (subject,content,date) values('$subject','$content','$time') ");
if(
$edit) echo "Row edited. \n <br>"; else echo mysql_error()."  \n <br> ";


//see edit and delete archive:
$row_id=1;
echo 
"Delete Archive :  \n <br>";
var_dump(KEDA::GetDeleteArchive($table));

echo 
"Edit Archive :  \n <br>";
var_dump(KEDA::GetEditArchiveData($table,$row_id));


//select data from db:
echo "Selected Data :  \n <br>";
var_dump(KEDA::Select($table));