Mistři v programování na #hovnokod

$bCancel = false;
while(!$bCancel)
{
	$bCnt++;
	$sql = "SELECT id, rDateTime, pDateTime, longitude, latitude, speed, reportId, inputs, peopIn, peopOut, COUNT(*) AS cnt FROM $tbname AS tblCur
			WHERE ".$repIds." AND pDateTime>'$fd' AND unitId=$unitid
			GROUP BY pDateTime, reportId ORDER BY pDateTime ASC LIMIT 0, 50";
	$request = mysql_query($sql) or die(mysql_error());
	$rCnt = 0;
	while(!$bCancel)
	{
		if($row=mysql_fetch_assoc($request))
		{
			if(!arrZoneCoordContains($row['longitude'],$row['latitude'],$arrZoneCoord[$zoneId]))
			{
				$bCancel = true;
			}
			$fd = $row['pDateTime'];
	   		array_push($arrRows, $row);
			$rCnt++;
		}
		elseif($rCnt==0)
		$bCancel=true;
	}
}

Anonymous,