我想知道你是否能指出我正确的方向。我扩展了mysqli类,但似乎无法调用错误函数..
<?php
class mysqli_ls extends mysqli
{
private $activeConnection = 0;
private $linkArr = array();
private $queryArr = array();
private $errorArr = array();
public function __construct()
{
}
/* Connection ************************************************************ */
public function connect($host='', $username='', $password='', $port='', $database='')
{
$no =& $this->activeConnection;
$no++;
if ( empty($host) || empty($username) || empty($password) || empty($port) || empty($database) )
{
$this->setError('1', 'connect','missing required variables');
return false;
}
$this->linkArr[ $no ] = parent::mysqli($host,$username,$password);
if ( $this->linkArr[ $no ] === false )
{
$this->setError(2, 'connect', parent::error( $this->linkArr[ $no ] ) );
return false;
}
return $no;
}
致命错误:在第31行的C:\ wamp \ www \ vhdocs \ test \ mysqli.class.php中调用未定义的方法mysqli :: error()
我也尝试过parent :: mysqli_error并遇到了同样的错误......我无法理解为什么我无法调用错误.....