<?php
//ini_set('display_errors', 1);
//ini_set('display_startup_errors', 1);
//error_reporting(E_ALL);
require_once "../sleekdb/SleekDB.php"; 
$dataDir = "../mydb";

$database = \SleekDB\SleekDB::store('jpdb', $dataDir);
 
      // $database->where( 'name', '!=', '1' )->delete();

  
   //  $results = $database->fetch();
     
      $results = $database
            ->orderBy( 'desc', '_id' )
          ->fetch();
          

echo "<center><table border=1 cellspacing=0>";

  echo "<tr>";
  echo  "<td>Name</td>";
  echo  "<td>Package</td>";
  echo  "<td>Email</td>";
  echo  "<td>Contact</td>";
  echo  "<td>Age</td>";
  echo  "<td>Gender</td>";
  echo  "<td>Date</td>";
  echo  "<td>Amt</td>";
  echo  "<td>IPAddress</td>";
    echo "</tr>";
    
foreach($results as $result){
    echo "<tr>";
  echo  "<td>" . $result['name'] . "</td>";
  echo  "<td>" . $result['package'] . "</td>";
  echo  "<td>" . $result['email'] . "</td>";
  echo  "<td>" . $result['contact'] . "</td>";
  echo  "<td>" . $result['age'] . "</td>";
  echo  "<td>" . $result['gender'] . "</td>";
  echo  "<td>" . $result['date'] . "</td>";
  echo  "<td>" . $result['amount'] . "</td>";
  echo  "<td>" . $result['ipaddress'] . "</td>";
    echo "</tr>";
}

echo "</table></center>";

/*

Array ( [0] => Array ( [name] => somdutt [package] => Standard Package [email] => tosomdutt@Gmail.com [contact] => 343242342 [age] => 332 [gender] => Male [date] => 2019-11-14 06:11:41 [amount] => 10000 [ipaddress] => 110.227.246.149 [_id] => 3 ) [1] => Array ( [name] => somdutt [package] => Standard Package [email] => tosomdutt@Gmail.com [contact] => 343242342 [age] => 332 [gender] => Male [date] => 2019-11-14 06:08:02 [amount] => 10000 [ipaddress] => 110.227.246.149 [_id] => 2 ) [2] => Array ( [name] => somdutt [package] => Standard Package [email] => tosomdutt@Gmail.com [contact] => 343242342 [age] => 332 [gender] => Male [date] => 2019-11-14 06:05:58 [amount] => 10000 [ipaddress] => 110.227.246.149 [_id] => 1 ) )

*/
       
            //print_r($users);

?>