示例#1
0
<?php

require_once '../ffdb/dbase.php';
$db = new Flatsql();
//create a database called school
$db->query("use dbase school");
//insert records into a table called phone
$db->query("truncate table phone");
//select all data
$row = $db->query("select * from phone");
//dump all data
echo "<pre>";
var_dump($row);
示例#2
0
<?php

//error_reporting(1);
require_once '../ffdb/dbase.php';
$db = new Flatsql();
//create a database called school
$db->query("use dbase school");
//insert records into a table called phone
$db->query("insert into phone('uid','first','phone') value(Null,'Tony','070603223456')");
//$db->query("insert into phone(uid,first,phone) value(Null,'Tony','070603223456')");
//select all data
$row = $db->query("select * from phone");
//dump all data
echo "<pre>";
var_dump($row);
示例#3
0
<?php

require_once '../ffdb/dbase.php';
$db = new Flatsql();
//create a database called school
$db->query("use dbase school");
//empty the phone table
$db->query("truncate table phone");
//insert records into a table called phone
$db->query("insert into phone(uid,first,phone) value(Null,'Tony','070603223456')");
$db->query("insert into phone(uid,first,phone) value(Null,'DHTML','08120755515')");
//select all data
$row = $db->query("select * from phone");
//loop through each row using associative array
foreach ($row as $data) {
    echo "<li>" . $data['first'] . ' - ' . $data['phone'];
}