public function status(){
$res = db::query('
SELECT `status`, `visits` FROM `nameid` WHERE `ip` = "%s"
',
$_SERVER['REMOTE_ADDR']
);
$tmp = $res->fetch_assoc();
$this->visits = $tmp['visits'];
$this->status = $tmp['status'];
return ($tmp['status'] < 6 && $this->visits < $this->limit);
}
Возможна ли такая конструкция на 5.2.17?$tmp = $res->fetch_assoc(); $this->visits = $tmp['visits']; $this->status = $tmp['status']; return ($tmp['status'] < 6 && $this->visits < $this->limit);
- Нет.
до 5.3.0 fetch_assoc работает с while:
while ($row = $result->fetch_assoc()) {
// do what you need.
}
дело в версии php или я ошибаюсь?