$sSQL = "select address_place_id from place_addressline where cached_rank_address <= $iMaxRank and place_id = $iPlaceID order by cached_rank_address desc,isaddress desc,distance desc limit 1";
- $iPlaceID = $oDB->getOne($sSQL);
- if (PEAR::IsError($iPlaceID))
- {
- var_Dump($sSQL, $iPlaceID);
- exit;
- }
+ $iPlaceID = chksql($oDB->getOne($sSQL));
if ($iPlaceID && $aPlace['place_id'] && $iMaxRank < 28)
{
$sSQL = "select address_place_id from place_addressline where cached_rank_address <= $iMaxRank and place_id = ".$aPlace['place_id']." order by cached_rank_address desc,isaddress desc,distance desc";