致命错误:对非对象上的成员函数FETCH_Assoc()的调用
function get_recent_highs($view_deleted_images=false){ $lower = $this->database->conn->real_escape_string($this->page_size * ($this->page_number - 1)); $query = "SELECT image_id, date_uploaded FROM `images` ORDER BY ((SELECT SUM( image_id=`images`.image_id ) FROM `image_votes` AS score) / (SELECT DATEDIFF( NOW( ) , date_uploaded ) AS diff)) DESC LIMIT " . $this->page_size . " OFFSET $lower"; //move to database class $result = $this->database->query($query); $page = array(); while($row = $result->fetch_assoc()) { try { array_push($page, new Image($row['image_id'], $view_deleted_images)); } catch(ImageNotFoundException $e) { throw $e; } } return $page;}
Database
Image
Fatal error: Call to a member function fetch_assoc() on a non-object
$result
神不在的星期二
HUH函数
慕容森