Наталья, спасибо за сылку, ознакомился, но переделать код выше под приведенное решение у меня не получилось. Ошибка в синтаксисе.
...
$element['type'] = 1;
$element['name'] = 'shop_items_catalog_table.shop_shops_id'; // <- объясните, что это
$element['prefix'] = ' or ';
$element['if'] = '=';
$element['value'] = $result;
$element['sufix'] = "
AND (shop_list_of_properties_table.shop_list_of_properties_id=134
AND CONVERT(shop_properties_items_table.shop_properties_items_value, UNSIGNED) > {$min}
AND shop_list_of_properties_table.shop_list_of_properties_id=134
AND CONVERT(shop_properties_items_table.shop_properties_items_value, UNSIGNED) < {$max}
) GROUP BY shop_items_catalog_table.shop_items_catalog_item_id
HAVING COUNT(shop_properties_items_table.shop_properties_items_id)= 1)";
$param['select'][] = $element;
...
Ошибка выполнения запроса! - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND shop_properties_items_table.shop_properties_items_value = '1.995' AND (sh' at line 9
Предупреждение: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource в файле /var/www/asta/data/www/gknk.ru/modules/shop/shop.class.php (строка 23460)
Ошибка выполнения запроса! - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND shop_properties_items_table.shop_properties_items_value = '1.995' AND (sh' at line 1
Скобочки перед group на результат не влияли.
Вообще в этом условии 1 лишнее, мне нужно решение из интервала. пробовал различные варианты с этими скобочками и условиями, или $element['value'] приравнивать не к числу, а = 'CONVERT(... '
Очевидно, что не так пробовал. Будте добры, помогите привести код из первого поста к правильному формату. Благодарю.