File: sample.basic.php

Recommend this page to a friend!
  Classes of Daniel Alan Guerrero Matamoros  >  PHP JSON Flat File Database  >  sample.basic.php  >  Download  
File: sample.basic.php
Role: Example script
Content type: text/plain
Description: Basic Sample
Class: PHP JSON Flat File Database
Create database tables stored as files in JSON
Author: By
Last change:
Date: 4 years ago
Size: 672 bytes
 

 

Contents

Class file image Download
<?php

require_once "jsonql.class.php";

$jql = new jsonql();
if(
$jql->createDB("sample")){
    echo
"Basic creating<BR/>";
   
$jql->addColumn("Name", "t");
   
$jql->addColumn("Lastname", "t");
   
$jql->addColumn("Age", "i");
   
$jql->addRow(array("Daniel", "Guerrero", 20));
   
$jql->addRow(array("Valeria", "Guerrero", 4));
   
$jql->addRow(array("Mia", "Efdent", 30));
   
$jql->printTable();
    echo
"<HR>";
    echo
"One row delete<BR/>";
   
$jql->deleteRow("Name", "Mia");
   
$jql->printTable();
    echo
"<HR>";
    echo
"All table delete";
   
$jql->deleteRow();
   
$jql->printTable();
} else {
    echo
"<BR/>Error!<BR/>";
}

?>


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