--- a/labs/busstopdensity.tile.php +++ b/labs/busstopdensity.tile.php @@ -1,6 +1,6 @@ prepare($query); + $query->execute(); + if (!$query) { + databaseError($conn->errorInfo()); return Array(); } - foreach( pg_fetch_all($result) as $row){ + foreach( $query->fetchAll() as $row){ $point = GoogleMapUtility::getOffsetPixelCoords($row['stop_lat'], $row['stop_lon'], $zoom, $X, $Y); //Count result only in the tile if( ($point->x > -$offset) && ($point->x < (GoogleMapUtility::TILE_SIZE+$offset)) && ($point->y > -$offset) && ($point->y < (GoogleMapUtility::TILE_SIZE+$offset))){