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/items.inc.php | |
| parent | 8aee7a4bf11b6a36d74892f56d8937219cba0be0 (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.php | 5 |
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; |
