inc/record.inc.php
changeset 78 effde559e0e9
parent 74 43c31dc98305
child 79 0c0aa144356a
--- a/inc/record.inc.php	Tue Feb 19 19:45:47 2008 +0000
+++ b/inc/record.inc.php	Mon Mar 03 20:32:33 2008 +0000
@@ -1305,16 +1305,15 @@
 		}
 
 		$sqlq = "SELECT domains.id, domains.name, count(records.id) AS numrec, zones.owner, records.domain_id
-				FROM domains, records, zones  
-				WHERE domains.id = records.domain_id 
-				AND zones.domain_id = domains.id 
+				FROM domains LEFT JOIN records ON domains.id = records.domain_id, zones  
+				WHERE zones.domain_id = domains.id 
 				AND domains.name LIKE ".$db->quote($question)." 
 				GROUP BY domains.id, domains.name, zones.owner, records.domain_id";
 		$result = $db->query($sqlq);
 		$ret_d = array();
 		while ($r = $result->fetchRow())
 		{
-		    if(xs($r['domain_id']))
+		    if(xs($r['id']))
 		    {
 			    $ret_d[] = array(
 				'id'			=>	$r['id'],