mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
replace mysql_ with db* (update with caution, it works for me but...)
git-svn-id: http://www.observium.org/svn/observer/trunk@2282 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -1,14 +1,20 @@
|
||||
<?php
|
||||
|
||||
## FIXME who wrote this? so ugly :)
|
||||
|
||||
function add_service($service) {
|
||||
global $id;
|
||||
global $hostname;
|
||||
echo("$service ");
|
||||
$sql = "INSERT INTO `services` (`device_id`,`service_ip`,`service_type`,`service_desc`,`service_param`,`service_ignore`)
|
||||
VALUES ('" . mres($id). "','" . mres($hostname) . "','" . mres($service) . "',
|
||||
'" . mres("auto discovered: $service") . "','" . mres("") . "','0')";
|
||||
|
||||
$query = mysql_query($sql);
|
||||
#$sql = "INSERT INTO `services` (`device_id`,`service_ip`,`service_type`,`service_desc`,`service_param`,`service_ignore`)
|
||||
# VALUES ('" . mres($id). "','" . mres($hostname) . "','" . mres($service) . "',
|
||||
# '" . mres("auto discovered: $service") . "','" . mres("") . "','0')";
|
||||
|
||||
$insert = array('device_id' => $id, 'service_ip' => $hostname, 'service_type' => $service, 'service_desc' => "auto discovered: $service", 'service_param' => "", 'service_ignore' => "0");
|
||||
|
||||
return $dbInsert($insert, 'services');
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user