diff options
author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-11-25 11:17:18 +0000 |
---|---|---|
committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-11-25 11:17:18 +0000 |
commit | 1e8cf592866d7330849fd60551be7b8e5344cc98 (patch) | |
tree | aba7fdf01a44fa71031e99363ffe448d4d03e6e6 /frontends/php/include/hosts.inc.php | |
parent | 8aee7a4bf11b6a36d74892f56d8937219cba0be0 (diff) | |
download | zabbix-1e8cf592866d7330849fd60551be7b8e5344cc98.tar.gz zabbix-1e8cf592866d7330849fd60551be7b8e5344cc98.tar.xz zabbix-1e8cf592866d7330849fd60551be7b8e5344cc98.zip |
Getting rid of DBget_field (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@2358 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/hosts.inc.php')
-rw-r--r-- | frontends/php/include/hosts.inc.php | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/frontends/php/include/hosts.inc.php b/frontends/php/include/hosts.inc.php index 87f67db6..b215715f 100644 --- a/frontends/php/include/hosts.inc.php +++ b/frontends/php/include/hosts.inc.php @@ -190,16 +190,11 @@ function get_host_by_hostid($hostid) { - $sql="select hostid,host,useip,ip,port,status from hosts where hostid=$hostid"; + $sql="select * from hosts where hostid=$hostid"; $result=DBselect($sql); if(DBnum_rows($result) == 1) { - $host["hostid"]=DBget_field($result,0,0); - $host["host"]=DBget_field($result,0,1); - $host["useip"]=DBget_field($result,0,2); - $host["ip"]=DBget_field($result,0,3); - $host["port"]=DBget_field($result,0,4); - $host["status"]=DBget_field($result,0,5); + return DBfetch($result); } else { @@ -220,12 +215,13 @@ $sql="select status,host from hosts where hostid=$hostid"; $result=DBselect($sql); - $old_status=DBget_field($result,0,0); + $row=DBfetch($result); + $old_status=$row["status"]; if($status != $old_status) { update_trigger_value_to_unknown_by_hostid($hostid); $sql="update hosts set status=$status where hostid=$hostid and status!=".HOST_STATUS_DELETED; - info("Updated status of host ".DBget_field($result,0,1)); + info("Updated status of host ".$row["host"]); return DBexecute($sql); } else |