From 224ef1379dfb1c35ca45dcee50072406c76f714a Mon Sep 17 00:00:00 2001 From: osmiy Date: Wed, 6 Dec 2006 15:48:46 +0000 Subject: - added supporting of sqlite database for frontend (Eugene) git-svn-id: svn://svn.zabbix.com/trunk@3571 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/include/items.inc.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'frontends/php/include/items.inc.php') diff --git a/frontends/php/include/items.inc.php b/frontends/php/include/items.inc.php index 9308cdd0..fc9d7e24 100644 --- a/frontends/php/include/items.inc.php +++ b/frontends/php/include/items.inc.php @@ -196,9 +196,8 @@ } } - $db_items = DBexecute("select itemid,hostid from items". - " where hostid=$hostid and key_=".zbx_dbstr($key)); - $db_item = DBfetch($db_items); + $db_item = DBfetch(DBselect("select itemid,hostid from items". + " where hostid=$hostid and key_=".zbx_dbstr($key))); if($db_item && $templateid == 0) { error("An item with the same Key already exists for host ".$host["host"].".". @@ -314,9 +313,8 @@ $delta=0; } - $db_items = DBexecute("select itemid from items". - " where hostid=$hostid and itemid<>$itemid and key_=".zbx_dbstr($key)); - $db_item = DBfetch($db_items); + $db_item = DBfetch(DBselect("select itemid from items". + " where hostid=$hostid and itemid<>$itemid and key_=".zbx_dbstr($key))); if($db_item && $templateid == 0) { error("An item with the same Key already exists for host ".$host["host"].".". @@ -534,7 +532,7 @@ return $result; } - function get_items_by_hostid($hostid) + function &get_items_by_hostid($hostid) { return DBselect("select * from items where hostid=$hostid"); } -- cgit