I think buck2bcr presumed it was an incoming variable, and didnt actually look at the code.
Your $zonelinessub variable is declared at your loop:
while ($query_data = mysql_fetch_array($result))
right?
That could mean that the loop doesnt even run once, so the variable doesnt exist.
You might be able to circumvent that by declaring
$zonelinessub = array();
before the loop.
However, a surefire solution would be to check $zonelinessub before the foreach(), by using [man]is_array/man