ezSQL是一個非常好用的PHP數據庫操作類
ezSQL的優點就不用多說了
下面是ezSQL中一些主要的函數
$db
$db
$db
$db
$db
$db
$db
$db
$db
$db
$db
ezSQL的使用方法很簡單
<?php
// 包含ezSQL的核心文件
include_once "ez_sql_core
// 包含ezSQL具體的數據庫文件
include_once "ez_sql_mysql
// 初始化數據庫對象並建立數據庫連接
$db = new ezSQL_mysql(
?>
下面是ezSQL中一些主要函數的應用實例
實例一
// Select multiple records from the database and print them out
$users = $db
foreach ( $users as $user ) {
// Access data using object syntax
echo $user
echo $user
}
實例二
// Get one row from the database and print it out
$user = $db
echo $user
echo $user
實例三
// Get one variable from the database and print it out
$var = $db
echo $var;
實例四
// Insert into the database
$db
實例五
// Update the database
$db
實例六
// Display last query and all associated results
$db
實例七
// Display the structure and contents of any result(s)
$results = $db
$db
實例八
// Get
$names = $db
foreach ( $names as $name ) {
echo $name;
}
實例九
// Same as above ‘but quicker’
foreach ( $db
echo $name;
}
實例十
// Map out the full schema of any given database and print it out
$db
foreach ( $db
$db
$db
}
$db
From:http://tw.wingwit.com/Article/program/PHP/201311/21297.html