summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/items.inc.php
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2005-11-25 11:17:18 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2005-11-25 11:17:18 +0000
commit1e8cf592866d7330849fd60551be7b8e5344cc98 (patch)
treeaba7fdf01a44fa71031e99363ffe448d4d03e6e6 /frontends/php/include/items.inc.php
parent8aee7a4bf11b6a36d74892f56d8937219cba0be0 (diff)
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/items.inc.php')
-rw-r--r--frontends/php/include/items.inc.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/frontends/php/include/items.inc.php b/frontends/php/include/items.inc.php
index e3979e2c..1db16857 100644
--- a/frontends/php/include/items.inc.php
+++ b/frontends/php/include/items.inc.php
@@ -81,9 +81,10 @@
$host=get_host_by_hostid($hostid);
- $sql="select count(*) from items where hostid=$hostid and key_='$key'";
+ $sql="select count(*) as cnt from items where hostid=$hostid and key_='$key'";
$result=DBexecute($sql);
- if(DBget_field($result,0,0)>0)
+ $row = DBfetch($result);
+ if($row["cnt"]>0)
{
error("An item with the same Key already exists for host ".$host["host"].". The key must be unique.");
return 0;