вместо
Код: Выделить всё
$tables=array('commands', 'owproperties', 'snmpproperties', 'zwave_properties', 'mqtt');
if (!is_array($no_linked) && $no_linked) {
$no_linked=array();
foreach($tables as $t) {
$no_linked[$k]='0';
}
} elseif (is_array($no_linked)) {
foreach($tables as $t) {
if (!isset($no_linked[$k])) {
$no_linked[$k]='1';
}
}
} else {
$no_linked=array();
foreach($tables as $t) {
$no_linked[$k]='1';
}
}
Код: Выделить всё
$tables = array(0=>'commands', 'owproperties', 'snmpproperties', 'zwave_properties', 'mqtt');
if (!is_array($no_linked))
{
$no_linked = array();
foreach($tables as $t)
$no_linked[$t] = '0';
}
else
{
foreach($tables as $t)
if (!isset($no_linked[$t]))
$no_linked[$t] = '1';
}
Код: Выделить всё
SELECT * FROM commands WHERE LINKED_OBJECT LIKE '" . DBSafe($this->object_title) . "' AND LINKED_PROPERTY LIKE '" . DBSafe($property) . "' AND " . $no_linked['commands']