From: Paul J R Date: Thu, 25 Oct 2012 07:31:46 +0000 (+1100) Subject: fixing a small undefined var bug X-Git-Url: http://git.pjr.cc/?a=commitdiff_plain;h=39de15eac6b59d9c49634f63e6fcd3ca03082a12;p=gwvp-mini.git fixing a small undefined var bug --- diff --git a/gwvpmini/gwvpmini_db.php b/gwvpmini/gwvpmini_db.php index fc6babc..d47bcee 100644 --- a/gwvpmini/gwvpmini_db.php +++ b/gwvpmini/gwvpmini_db.php @@ -737,7 +737,7 @@ function gwvpmini_GetMessagesForId($uid) error_log("request message for uid, $uid with sql $sql"); $i = 0; - if(!$res) return 0; + if(!$res) return 0; foreach($res as $row) { $retval[$i]["id"] = $row["msgs_id"]; $retval[$i]["type"] = $row["msgs_type"]; @@ -745,8 +745,8 @@ function gwvpmini_GetMessagesForId($uid) $i++; } - - return $retval; + if($i == 0) return 0; + else return $retval; }