inc/record.inc.php
changeset 98 9c10fd623368
parent 93 92901b76946a
child 106 41d05ff53708
--- a/inc/record.inc.php	Thu Mar 27 17:44:49 2008 +0000
+++ b/inc/record.inc.php	Thu Mar 27 17:55:33 2008 +0000
@@ -238,22 +238,12 @@
 
 	global $db;
 
-	$query = "SELECT * FROM records WHERE id = " . $db->quote($rid) ;
+	$query = "SELECT id AS rid, domain_id AS zid, name, type, content, ttl, prio, change_date FROM records WHERE id = " . $db->quote($rid) ;
 
 	$response = $db->query($query);
 	if (PEAR::isError($response)) { error($response->getMessage()); return false; }
-
-	while ($r = $response->fetchRow()) {
-		$return[] = array(
-			"rid"		=>	$r['id'],
-			"zid"		=>	$r['domain_id'],
-			"name"		=>	$r['name'],
-			"type"		=>	$r['type'],
-			"content"	=>	$r['content'],
-			"ttl"		=>	$r['ttl'],
-			"prio"		=>	$r['prio'],
-			"change_date"	=>	$r['change_date']);
-	}
+	
+	$return = $response->fetchRow();
 	return $return;
 }
 
@@ -277,7 +267,7 @@
 		if ($record['type'] == "SOA") {
 			error(_('You are trying to delete the SOA record. If are not allowed to remove it, unless you remove the entire zone.'));
 		} else {
-			$quote = "DELETE FROM records WHERE id = " . $db->quote($rid);
+			$query = "DELETE FROM records WHERE id = " . $db->quote($rid);
 			$response = $db->query($query);
 			if (PEAR::isError($response)) { error($response->getMessage()); return false; }
 			return true;