inc/toolkit.inc.php
changeset 107 fee925b9bdef
parent 91 f6c1336dbef8
child 111 0a2342a64b83
equal deleted inserted replaced
106:41d05ff53708 107:fee925b9bdef
   151         global $db;
   151         global $db;
   152 	global $sql_regexp;
   152 	global $sql_regexp;
   153         $query = "SELECT 
   153         $query = "SELECT 
   154 			domains.id AS domain_id,
   154 			domains.id AS domain_id,
   155 			zones.owner,
   155 			zones.owner,
   156 			records.id,
       
   157 			domains.name AS domainname
   156 			domains.name AS domainname
   158 			FROM domains
   157 			FROM domains
   159 			LEFT JOIN zones ON domains.id=zones.domain_id 
   158 			LEFT JOIN zones ON domains.id=zones.domain_id 
   160 			LEFT JOIN records ON records.domain_id=domains.id
   159 			WHERE substring(domains.name,1,1) ".$sql_regexp." ".$db->quote("^".$letter);
   161 			AND substring(domains.name,1,1) ".$sql_regexp." ".$db->quote("^".$letter);
       
   162 	$db->setLimit(1);
   160 	$db->setLimit(1);
   163         $result = $db->query($query);
   161         $result = $db->query($query);
   164         $numrows = $result->numRows();
   162         $numrows = $result->numRows();
   165         if ( $numrows == "1" ) {
   163         if ( $numrows == "1" ) {
   166                 return 1;
   164                 return 1;