Hi, i need help for a little modify to the query
this is the code i've already modify and it works,
if the property is set to ##*## it should filter the results where the property isn't "chiuso"
now i need to order the results by this property column DESC
this thing doen't work
i've tried adding after
}elseif ( $value=="##*##") {
this code
$query2 = ' , '.$id . '.`' . $name .' DESC ';
and i add at the end of the query
$query .= ' ORDER BY `sbj`.`ordering` ASC ';
$query .= $query2;
but it gives me error which is the right way?? please help me!!!
if (!empty($this->_lists['properties'])) {
// filter by template properties
foreach ($this->_lists['properties'] as $templateId => $properties) {
$template = $templateHelper->getTemplateById($templateId);
/* @var $template ATemplate */
$id = '`tmpl' . $templateId . '`'; // alias of template database table
foreach ($properties as $name => $param) { // check if properties has value to filter
$value = JString::trim($param['value']);
if ($value){
if ($param['type'] == 'text' || $param['type'] == 'textarea'){ // fulltext search
$where[] = $id . '.`' . $name . '` LIKE ' . $this->_db->Quote('%' . $value . '%');
$query2 ="";
}elseif ( $value=="##*##") {
$where[] = $id . '.`' . $name . '` NOT LIKE ' . $this->_db->Quote('%' . $closed . '%');
$query2 = ' , '.$id . '.`' . $name .' DESC ';
} else {// search by key
$where[] = $id . '.`' . $name . '` = ' . $this->_db->Quote($value);
$query2 ="";
}
}
}
if (!empty($where)) // there is params to filter - join with template
$query .= ' LEFT JOIN `' . $template->getDBTableName() . '` AS ' . $id . ' ON ' . $id . '.`id` = `sbj`.`id` ';
}
}
this is the error
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in /home/w45184/domains/mydomain.com/public_html/libraries/joomla/database/database/mysqli.php on line 263
thank you for your help