Pear DB 新手入门指南教程第1/3页(2)

3.2         执行数据库

 <?php
// Once you have a valid DB object
...
$sql = "select * from clients";
// If the query is a "SELECT", $db->query will return
// a DB Result object on success.
// Else it simply will return a DB_OK
// On failure it will return a DB Error object.
$result = $db->query($sql);
// Always check that $result is not an error
if (DB::isError($result)) {
        die ($result->getMessage());
}
....
?> 
 

3.3         获得select的数据

1

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/f9818433e7720f907ded59ea41abe221.html