From 795d7745e890474b8870130dde0a4f9792562a16 Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Wed, 11 Jan 2012 15:42:17 +0100 Subject: Comments model fixed. * Fixed a MySQL query. * Comments::populate_by_sqlrow fixed. --- ratatoeskr/sys/models.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ratatoeskr') diff --git a/ratatoeskr/sys/models.php b/ratatoeskr/sys/models.php index 02fa0fc..913177e 100644 --- a/ratatoeskr/sys/models.php +++ b/ratatoeskr/sys/models.php @@ -905,7 +905,7 @@ class Comment extends BySQLRowEnabled protected function populate_by_sqlrow($sqlrow) { $this->id = $sqlrow["id"]; - $this->article = Article::by_id($sqlrow["article"]); + $this->article_id = $sqlrow["article"]; $this->language = $sqlrow["language"]; $this->author_name = $sqlrow["author_name"]; $this->author_mail = $sqlrow["author_mail"]; @@ -945,7 +945,7 @@ class Comment extends BySQLRowEnabled public static function all() { $rv = array(); - $result = qdb("SELECT `id`, `article`, `language`, `author_name`, `author_mail`, `text`, `timestamp`, `visible`, `read_by_admin` WHERE 1"); + $result = qdb("SELECT `id`, `article`, `language`, `author_name`, `author_mail`, `text`, `timestamp`, `visible`, `read_by_admin` FROM `PREFIX_comments` WHERE 1"); while($sqlrow = mysql_fetch_assoc($result)) $rv[] = self::by_sqlrow($sqlrow); return $rv; -- cgit v1.2.3-54-g00ecf