求大神幫助錯誤碼:Fatal error: Call to undefined function mysql_connect() inE:\kechengsheji\AppServ\www\com\db.php on line 16錯誤代碼:<?phpclass DataAccess{// $conn存儲數據庫連接字符串 public $link;// 數據查詢的結果集var $res;function getLink(){return $this->link;}function connect(){$this->link = mysql_connect('localhost', 'root', '111');---------------------------------------這里----------------------------if (!$this->link) {die(' Could not connect: ' . mysql_error());}mysql_select_db('job', $this->link) or die ('Cannot use job : ' . mysql_error());//echo 'Connected successfully';return $this->link; }function close(){// 釋放結果集if(!empty($this->res))mysql_free_result($this->res);// 關閉連接if($this->link)mysql_close($this->link);}function getRowNum(){return mysql_num_rows($this->res);}/*數據查詢函數*/function &query($sql){mysql_query("set names 'gbk'");$this->res = mysql_query($sql) or die('數據庫查詢錯誤: ' . mysql_error());return $this->res;}//插入刪除修改操作function &perform($sql){mysql_query("set names 'gbk'");$this->res = mysql_query($sql) or die('數據庫查詢錯誤: ' . mysql_error());if($this->res)return true;return false;}} ?>
- 2 回答
- 0 關注
- 170 瀏覽
添加回答
舉報
0/150
提交
取消