From d526decc4884710ae7fafe7aa5171e7f59b24292 Mon Sep 17 00:00:00 2001 From: jhunkeler Date: Sun, 27 Dec 2009 15:44:57 +0000 Subject: MySQL -> MySQLi Fixed memory leaks after Fetching arrays Removed all while loops that interfaced with $db->Fetch() Rewrote RSS module Fixed syntax error in donations module Fixed link structure for news module Reverting to old page display method git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@402 c5b2fb0a-d05d-0410-98c8-828840a80ff6 --- modules/admin/pages/functions.php | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'modules/admin/pages/functions.php') diff --git a/modules/admin/pages/functions.php b/modules/admin/pages/functions.php index 104a19a..fc97ffc 100644 --- a/modules/admin/pages/functions.php +++ b/modules/admin/pages/functions.php @@ -26,10 +26,7 @@ function ListArticles($pageid){ global $db; $result = $db->Query("SELECT article_id,title FROM bayonet_articles WHERE `page_id` = $pageid ORDER BY `weight`"); - while(($row = $db->Fetch($result))!=false) - { - $articles[] = $row; - } + $articles = $db->Fetch($result); echo ""; @@ -65,12 +62,16 @@ function EditArticle($article_id){ global $db; //Grab the page from the database according to the $article_id passed to the function. + // {{{ XXX: FIXME -- Needs to be re-written + /* $result = $db->Query("SELECT title,text FROM bayonet_articles WHERE article_id = '$article_id'"); while(($row = $db->Fetch($result))!=false) { //We only want one row, so we don't have to $article[]... No foreach necessary. $article = $row; - } + } + */ + // }}} ?>
@@ -87,11 +88,7 @@ function EditArticle($article_id){ function ListPages($pid = NULL) { global $db; - $result = $db->Query("SELECT page_id,title FROM bayonet_pages"); - while(($row = $db->Fetch($result))!=false) - { - $pages[] = $row; - } + $pages = $db->Query("SELECT page_id,title FROM bayonet_pages"); echo 'Select page: