长沙北大青鸟作者:科泰校区Easy Chen
pear install http://creole.phpdb.org/pear/creole-current.tgz
pear install http://creole.phpdb.org/pear/jargon-current.tgz
require_once 'creole/Creole.php';
Warning: main(/creole/Creole.php) [function.main]: failed to open stream: No such file or directory in c:program filesEasyPHP5homedevtest.php on line 2Fatal error: main() [function.require]: Failed opening required '/creole/Creole.php' (include_path='.;C:php5pear') in c:program filesEasyPHP5homedevtest.php on line 2
;;;;;;;;;;;;;;;;;;;;;;;;;; Paths and Directories ;;;;;;;;;;;;;;;;;;;;;;;;;; ; UNIX: "/path1:/path2";include_path = ".:/php/includes";; Windows: "path1;path2";include_path = ".;c:phpincludes"
include_path = ".;C:Program FilesEasyPHP5phpPEAR"
<?phprequire_once 'creole/Creole.php'; $dsn = "mysql://root@localhost/r4"; $conn = Creole::getConnection($dsn); $rs = $conn->executeQuery("SELECT * FROM user");while($rs->next()){ echo $rs->getString("login_name") . " (" . $rs->getInt("id") . ")";}?>
Root // Creole的根目录 ├─common // 存放了Creole的抽象类├─drivers│ ├─mssql │ │ └─metadata // mssql实现│ ├─mysql │ │ └─metadata // mysql实现│ ├─pgsql│ │ └─metadata│ └─sqlite│ └─metadata├─metadata // 数据表原始信息类└─util └─sql
public function setLimit($v);public function getLimit();public function setOffset($v);public function getOffset();public function close();public function execute($sql, $fetchmode = null);public function getResultSet();public function executeQuery($sql, $fetchmode = null);public function executeUpdate($sql);public function getMoreResults();public function getConnection();
public function getResource();public function setFetchmode($mode);public function getFetchmode(); public function isIgnoreAssocCase();public function next();public function previous();public function relative($offset);public function absolute($pos);public function seek($rownum); public function first();public function last();public function beforeFirst();public function afterLast();public function isAfterLast();public function isBeforeFirst();public function getCursorPos();public function getRow();public function getRecordCount();public function close();public function get($column);public function getArray($column);public function getBoolean($column);public function getBlob($column);public function getClob($column);public function getDate($column, $format = '%x'); public function getFloat($column);public function getInt($column); public function getString($column);public function getTime($column, $format = '%X');public function getTimestamp($column, $format = 'Y-m-d H:i:s');