/** * 构造函数 */ private function __construct($table) { if (!isset($table)) { throw new Exception("you need to specify the table name for this DB model"); } if (self::$_db === null) { self::$_db = WF_Com_Db_PDO::Instance(); } $this->table = $table; }
/** * 字符串转义函数 转义引号防止SQL注入 */ function wf_escape($val) { WF_Com_Db_PDO::Instance()->escape($val); }