Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- data-pick.php 2017-03-01 12:23:28.632092866 +0000
- +++ data-pick.php-PRE-PHP7 2015-08-07 13:36:51.668196377 +0100
- @@ -30,9 +30,9 @@
- $observium_found = FALSE;
- }
- -$link = mysqli_connect($config['db_host'],$config['db_user'],$config['db_pass'])
- - or die('Could not connect: ' . mysqli_error($link));
- - mysqli_select_db($link,$config['db_name']) or die('Could not select database: '.mysqli_error($link));
- +$link = mysql_connect($config['db_host'],$config['db_user'],$config['db_pass'])
- + or die('Could not connect: ' . mysql_error());
- + mysql_selectdb($config['db_name'],$link) or die('Could not select database: '.mysql_error());
- // ******************************************
- @@ -263,7 +263,7 @@
- //$SQL_picklist .= " order by name_cache;";
- // Link query
- - $result = mysqli_query($link,"SELECT device_id,hostname FROM devices ORDER BY hostname");
- + $result = mysql_query("SELECT device_id,hostname FROM devices ORDER BY hostname");
- //$hosts = mysql_fetch_assoc($result);
- //$result = mysql_query($SQL_picklist);
- $hosts = 1;
- @@ -278,7 +278,7 @@
- print '<option '.($host_id==-1 ? 'SELECTED' : '' ).' value="-1">Any</option>';
- print '<option '.($host_id==0 ? 'SELECTED' : '' ).' value="0">None</option>';
- - while ($host = mysqli_fetch_assoc($result))
- + while ($host = mysql_fetch_assoc($result))
- {
- print '<option ';
- if($host_id==$host['device_id']) print " SELECTED ";
- @@ -301,14 +301,14 @@
- }
- $query .= " ORDER BY hostname,ports.ifAlias";
- - $result = mysqli_query($link,$query);
- + $result = mysql_query($query);
- // print $SQL_picklist;
- $i=0;
- - if( mysqli_num_rows($result) > 0 )
- + if( mysql_num_rows($result) > 0 )
- {
- - while ($queryrows = mysqli_fetch_assoc($result)) {
- + while ($queryrows = mysql_fetch_assoc($result)) {
- echo "<li class=\"row".($i%2)."\">";
- $key = $queryrows['device_id']."','".$queryrows['hostname']."','".$queryrows['port_id']."','".$queryrows['ifAlias']."','".addslashes($queryrows['ifDescr'])."','".$queryrows['ifIndex'];
- echo "<a href=\"#\" onclick=\"update_source_step1('$key')\">". $queryrows['hostname'] . "/" . $queryrows['ifDescr'] . " Desc:" . $queryrows['ifAlias'] . ":</a>";
- @@ -356,8 +356,8 @@
- }
- //$SQL_picklist .= " order by title_cache";
- - $query = mysqli_query($link,"SELECT id,hostname AS name FROM `devices` ORDER BY hostname");
- - $hosts = mysqli_fetch_assoc($query);
- + $query = mysql_query("SELECT id,hostname AS name FROM `devices` ORDER BY hostname");
- + $hosts = mysql_fetch_assoc($query);
- ?>
- <html>
- @@ -475,11 +475,11 @@
- print '<input id="overlib" name="overlib" type="checkbox" value="yes" '.($overlib ? 'CHECKED' : '' ).'> <label for="overlib">Set both OVERLIBGRAPH and INFOURL.</label><br />';
- print '</form><div class="listcontainer"><ul id="dslist">';
- - $result = mysqli_query($SQL_picklist);
- - if( mysqli_num_rows($result) > 0)
- + $result = mysql_query($SQL_picklist);
- + if( mysql_num_rows($result) > 0)
- {
- $i=0;
- - while($queryrows = mysqli_fetch_assoc($result)) {
- + while($queryrows = mysql_fetch_assoc($result)) {
- echo "<li class=\"row".($i%2)."\">";
- $key = $queryrows['id'];
- $name = $queryrows['name'];
Advertisement
Add Comment
Please, Sign In to add comment