- $aPolygons = array();
- while ($iTotalBroken && !sizeof($aPolygons)) {
- $sSQL = 'select osm_type as "type",osm_id as "id",class as "key",type as "value",name->\'name\' as "name",';
- $sSQL .= 'country_code as "country",errormessage as "error message",updated';
- $sSQL .= " from import_polygon_error";
- $sSQL .= " where updated > 'now'::timestamp - '".$iDays." day'::interval";
- $iDays++;
+$iTotalBroken = (int) $oDB->getOne('select count(*) from import_polygon_error');
+
+$aPolygons = array();
+while ($iTotalBroken && empty($aPolygons)) {
+ $sSQL = 'select osm_type as "type",osm_id as "id",class as "key",type as "value",name->\'name\' as "name",';
+ $sSQL .= 'country_code as "country",errormessage as "error message",updated';
+ $sSQL .= ' from import_polygon_error';