inc/record.inc.php
changeset 88 fa948cc3727e
parent 87 654262e698e2
child 93 92901b76946a
equal deleted inserted replaced
87:654262e698e2 88:fa948cc3727e
   604 					count(records.domain_id) AS record_count
   604 					count(records.domain_id) AS record_count
   605 					FROM domains, records 
   605 					FROM domains, records 
   606 					WHERE domains.id = " . $db->quote($zone_id) . "
   606 					WHERE domains.id = " . $db->quote($zone_id) . "
   607 					AND domains.id = records.domain_id 
   607 					AND domains.id = records.domain_id 
   608 					GROUP BY domains.id";
   608 					GROUP BY domains.id";
   609 
   609 		$result = $db->query($query);
   610 		$response = $db->queryRow($query);
   610 		if (PEAR::isError($result)) { error($result->getMessage()); return false; }
   611 		if (PEAR::isError($response)) { error($response->getMessage()); return false; }
   611 
   612 		$return = array(
   612 		if($result->numRows() != 1) {
   613 			"name"		=>	$response['name'],
   613 			error(_('Function returned an error (multiple zones matching this zone ID).'));
   614 			"type"		=>	$response['type'],
   614 			return false;
   615 			"master_ip"	=>	$response['master_ip'],
   615 		} else {
   616 			"record_count"	=>	$response['record_count']);
   616 			$r = $result->fetchRow();
       
   617 			$return = array(
       
   618 				"name"		=>	$r['name'],
       
   619 				"type"		=>	$r['type'],
       
   620 				"master_ip"	=>	$r['master_ip'],
       
   621 				"record_count"	=>	$r['record_count']
       
   622 				);
       
   623 		}
   617 		return $return;
   624 		return $return;
   618 	}
   625 	}
   619 }
   626 }
   620 
   627 
   621 
   628