[feladat @ 127]
authorpeter
Mon, 03 Mar 2008 20:32:33 +0000
changeset 78 effde559e0e9
parent 77 e55145eab223
child 79 0c0aa144356a
[feladat @ 127] Bugfix for ticket:5 : Modified the query which searches zones to also find empty zones by adding a LEFT JOIN.
inc/record.inc.php
--- 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'],