From 830d850cfba9154d3d745eca095860c8d11a6665 Mon Sep 17 00:00:00 2001 From: hugetoad Date: Wed, 5 Oct 2005 19:30:39 +0000 Subject: Minor changes. git-svn-id: svn://svn.zabbix.com/trunk@2116 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- src/libs/zbxdbhigh/graph.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'src/libs/zbxdbhigh') diff --git a/src/libs/zbxdbhigh/graph.c b/src/libs/zbxdbhigh/graph.c index 1f56b35f..0e35d322 100644 --- a/src/libs/zbxdbhigh/graph.c +++ b/src/libs/zbxdbhigh/graph.c @@ -88,20 +88,27 @@ int DBadd_graph_item_to_linked_hosts(int gitemid,int hostid) if(hostid==0) { - $sql="select hostid,templateid,graphs from hosts_templates where templateid=".$item["hostid"]; + snprintf(sql,sizeof(sql)-1,"select hostid,templateid,graphs from hosts_templates where templateid=%d", item.hostid); } else { - $sql="select hostid,templateid,graphs from hosts_templates where hostid=$hostid and templateid=".$item["hostid"]; + snprintf(sql,sizeof(sql)-1,"select hostid,templateid,graphs from hosts_templates where hostid=%d and templateid=%d", hostid, item.hostid); } - $result=DBselect($sql); - while($row=DBfetch($result)) + + result=DBselect(sql); + for(i=0;i