mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added a fix for matching table names
This commit is contained in:
@ -80,13 +80,9 @@ if( isset($_GET['term'],$_GET['device_id']) ) {
|
||||
$chk = $memcache->get('rule-suggest-toplvl');
|
||||
}
|
||||
if( !(sizeof($chk) > 0) || $chk === false ) {
|
||||
$tmp = dbFetchRows('SHOW TABLES');
|
||||
$tmp = dbFetchRows("SELECT TABLE_NAME FROM information_schema.COLUMNS WHERE COLUMN_NAME = 'device_id'");
|
||||
foreach( $tmp as $tst ) {
|
||||
$tbl = array_shift($tst);
|
||||
$chhk = dbFetchRows('SELECT device_id FROM '.$tbl.' LIMIT 1');
|
||||
if( isset($chhk[0]['device_id']) ) {
|
||||
$chk[] = $tbl.'.';
|
||||
}
|
||||
$chk[] = $tst['TABLE_NAME'].'.';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user