1. PHP / Говнокод #25

    +27.8

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    $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;
    	}
    }

    O break'aх мы не знаем.

    Запостил: guest, 27 Ноября 2008

    Комментарии (10) RSS

    Добавить комментарий