Я расширил класс mysqli_result следующим образом:
class mysqli_Extended extends mysqli {
public function Execute($query) {
$this->real_query($query);
return new mysqliResult_Extended($this);
}
public function Insert_Id() {
return $this->insert_id;
}
public function Affected_Rows() {
return $this->affected_rows;
}
}
class mysqliResult_Extended extends MySQLi_Result {
public $fields;
public $queryResults;
public $row_count;
public function __construct($opt) {
parent::__construct($opt);
$this->queryResults = $this->fetch_all(MYSQLI_BOTH); <-- this is line 28
$this->fields = $this->queryResults[0];
$this->row_count = $this->num_rows; <-- this is line 30
$this->close(); <-- this is line 31
}
public function getrows() {
return $this->queryResults;
}
public function recordcount() {
return $this->row_count;
}
}
Каждый раз, когда я делаю запрос, который использует INSERT, я получаю следующие ошибки:
Warning: mysqli_result::fetch_all() [mysqli-result.fetch-all]: Couldn't fetch mysqliResult_Extended in /home/xxx/xxx/xxx/xxx/dB.class.php on line 28
Warning: mysqliResult_Extended::__construct() [mysqliresult-extended.--construct]: Couldn't fetch mysqliResult_Extended in /home/xxx/xxx/xxx/xxx/dB.class.php on line 30
Warning: mysqli_result::close() [mysqli-result.close]: Couldn't fetch mysqliResult_Extended in /home/xxx/xxx/xxx/xxx/dB.class.php on line 31
Пока нет ошибок, если я выполню запрос типа SELECT.
Есть идеи, что может быть причиной этого?