求大神帮助错误码: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 关注
- 102 浏览
添加回答
举报
0/150
提交
取消