自己寫的, 歡迎討論... ... 不知道好不好用就是了
.gif)
.
<?php
define('DB_USER', '');
define('DB_PW', '');
define('DB_HOST', '');
define('DB_DBNAME', '');
define('DEBUG', true);
define('DB_Charact', '');
define('DB', 'mysql');
if (defined('DB_Charact')) define('DB_Charact', '');
if (defined('DEBUG')) define('DEBUG', true);
//if (defined('')) define();
interface DB {
function __construct($start_link=true, $persistent=false);
function SetLink ($user='', $password='', $database='', $host='loaclhost');
function SetCharact($charact = '');
function error();
function close();
function SelectDB();
function query($sql, $re_id='RESULT_ID');
function affectedRows();
function insertId();
function numRows($re_id='RESULT_ID');
function fetchObject($re_id='RESULT_ID', $obj=null);
function fetchArray($re_id='RESULT_ID');
function fetchAssoc($re_id='RESULT_ID');
function fetchRow($re_id='RESULT_ID');
function free($re_id='RESULT_ID');
function Seek($rows = 0);
function Debug($debug=0, $sql='');
function __destruct();
}
class SQL {
private $obj;
function __construct($start_link=true, $persisent=false){
if (!defined('DB') || DB == '') die('DB_TYP not set');
$db_typ = DB;
require_once($db_typ .'.php');
$this->obj = new $db_typ($start_link, $persisent);
return $this->obj;
}
function SetLink ($user='', $password='', $database='', $host='loaclhost'){
return $this->obj->SetLink($user, $password, $database, $host);
}
function SetCharact($charact = ''){
return $this->obj->SetCharact($charact);
}
function close(){
return $this->obj->close();
}
function SelectDB(){
return $this->obj->SelectDB();
}
function query($sql, $re_id='RESULT_ID'){
return $this->obj->query($sql, $re_id);
}
function numRows($re_id='RESULT_ID'){
return $this->obj->numRows($re_id);
}
function affectedRows(){
return $this->obj->affectedRows();
}
function insertId(){
return $this->obj->ins
[ 瀏覽完整內容請先註冊或登入會員。]