Fix Issue with SQL syntax reported by kc2vrj
Correct quotation and simplify logic to avoid complex SQL statements. Bind strings Confirmed fix of issue reported by kc2vrj.
This commit is contained in:
parent
0011581fc0
commit
12c8f30464
|
@ -205,15 +205,13 @@ class dbinterface
|
|||
case 'byciscoid':
|
||||
if (!empty($filter)) {
|
||||
if (!empty($filter['model'])) {
|
||||
if (strpos($filter['model'], 'loadInformation')) {
|
||||
$stmt = $dbh->prepare('SELECT ' . $sel_inf . ' FROM sccpdevmodel WHERE (loadinformationid =' . $filter['model'] . ') ORDER BY model');
|
||||
} else {
|
||||
$stmt = $dbh->prepare('SELECT ' . $sel_inf . ' FROM sccpdevmodel WHERE (loadinformationid = loadInformation' . $filter['model'] . ') ORDER BY model');
|
||||
if (!strpos($filter['model'], 'loadInformation')) {
|
||||
$filter['model'] = 'loadInformation' . $filter['model'];
|
||||
}
|
||||
$stmt = $dbh->prepare("SELECT {$sel_inf} FROM sccpdevmodel WHERE (loadinformationid = :model ) ORDER BY model");
|
||||
$stmt->bindParam(':model', $filter['model'], \PDO::PARAM_STR);
|
||||
} else {
|
||||
$stmt = $dbh->prepare('SELECT ' . $sel_inf . ' FROM sccpdevmodel ORDER BY model');
|
||||
$stmt = $dbh->prepare("SELECT {$sel_inf} FROM sccpdevmodel ORDER BY model");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue