- Code: Select all
<?php error_reporting(E_ALL);
require_once('basictable.class.php');
$dbase='data1'; $table='members';
$tb1=new bdbtable($dbase, $table);
$tb1->tbload(); // loads table from DRIVE into RAM memory PHP variables
$cname='age'; $cvalue='25';
$tb1->tbfdone($cname,$cvalue); // fd-one = find one value, useful for 'unique' column check
$res=$tb1->trone; // TableRowOne - Get result array, The complete row of first found item
// display result row
echo '<b>Find One: '.$cname.'=>'.$cvalue."</b><br>\n";
foreach( $res AS $x )
echo $x." ";
echo "\n";
// Optional, show table info, variables, both ASCII & HEX output - for debug/check
$tb1->tbshow();
?>
in short:
- Code: Select all
<?php
require_once('basictable.class.php');
$tb1=new bdbtable('data1', 'members');
$tb1->tbload();
$tb1->tbfdone('age', '25');
$res=$tb1->trone;
echo '<b>Find One: age=>25</b>'."<br>\n";
foreach( $res AS $x ) echo $x." ";
exit();
?>
