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 --- admin/calendar/functions.php | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'admin/calendar/functions.php') diff --git a/admin/calendar/functions.php b/admin/calendar/functions.php index 8d1d6a1..9983870 100644 --- a/admin/calendar/functions.php +++ b/admin/calendar/functions.php @@ -90,25 +90,26 @@ echo ""; $result = $db->Query("SELECT * FROM bayonet_events WHERE `date` = '$date' ORDER BY `time`"); - while(($row = $db->Fetch($result))!=false) + $row = $db->Fetch($result); + foreach($row as $event) { $tmp = true; - $datetime = date_create($date.' '.$row['time']); - $time = date_format($datetime, 'g:ia'); //gets time in hour:minutes am|pm + $datetime = date_create($date.' '.$event['time']); + $time = date_format($datetime, 'g:ia'); //gets time in hour:minutes am|pm ?> - - + + - + @@ -116,7 +117,6 @@ "; @@ -391,10 +391,9 @@ $db->Query("UPDATE `bayonet_events` SET `title` = '$title', `text` = '$text', `c } */ global $db; $result = $db->Query("SELECT title,color FROM bayonet_events WHERE `date` = '$sqlDate' LIMIT 1"); - while(($row = $db->Fetch($result))!=false) - { - $isEvent = true; - } + $events = $db->Fetch($result); + $isEvent = empty($events) ? false : true; + if($useCurDate) echo ""; else -- cgit
         - Edit + Edit  |  - Delete + Delete




There are no events posted for this day.