i got a problem and i cant figure out why it stopping
<?php
	function connect()
	{
		$result = $this -> bot -> db -> select("SELECT * FROM #___automsgs", MYSQL_ASSOC);
		$highestmsg = $this -> bot -> db -> select("SELECT ID FROM #___automsgs ORDER BY ID DESC LIMIT 1", MYSQL_ASSOC);
		if (!empty($result))
		{
			$online = $this -> bot -> db -> select("SELECT * FROM #___online WHERE botname = '" . $this -> bot -> botname	. "' AND status_gc = 1", MYSQL_ASSOC);
			if (!empty($online))
			{
				foreach ($online as $member)
				{
					$result2 = "";
					$result2 = $this -> bot -> db -> select("SELECT * FROM #___users WHERE nickname = '".$member[nickname]."'", MYSQL_ASSOC);
					foreach ($result as $msg)
					{
						if ($msg[ID] > $result2[lastmsg])
						{
							$this -> bot -> send_tell($member[nickname], "Mass Message From ##highlight##".$msg[added_by]."##end##  ".$msg[msg]."", 1);
						}
					}
					echo "meep ".$highestmsg[0][ID]."\n"; doe
					$this -> bot -> db -> query("UPDATE #___users SET lastmsg = '".$highestmsg[0][ID]."' WHERE nickname = '".$member[nickname]."'");
				}
			}
		}
	}
?>
now it sends out the mass message but thats it,                
echo "meep ".$highestmsg[0][ID]."\n";
doesnt happen or the update after it
any idea why?