- Posts: 515
- Thank you received: 22
SQL error message on filters
- jouwnaambord.nl
-
Topic Author
- Offline
Less
More
10 years 3 months ago #246156
by jouwnaambord.nl
SQL error message on filters was created by jouwnaambord.nl
-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.5.1
-- PHP version -- : 5.5.9
-- Error-message(debug-mod must be tuned on) -- : 1064 - 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 ':: DESC LIMIT 0, 8' at line 1 SQL=SELECT DISTINCT b.* FROM #__hikashop_product_category AS a LEFT JOIN #__hikashop_product AS b ON a.product_id=b.product_id WHERE b.product_published=1 AND b.product_type = 'main' AND a.category_id IN (39,97,16,115,29,31,34,50,51,52,78,77,75,74,76,79,84,83,82,87,88,89,91,93,94,92,95,98,99,100,101,102,103,106,114,108,109,116,117,118,119,120,123,124,127,126,128,2) AND b.product_quantity!=0 AND (b.product_access = 'all' OR b.product_access LIKE '%,9,%') ORDER BY 30:: DESC LIMIT 0, 8
I get several SQL errors on different Filters. Some work fine, others don't (see Error message above). Can't figure out what's wrong?
-- Joomla version -- : 3.5.1
-- PHP version -- : 5.5.9
-- Error-message(debug-mod must be tuned on) -- : 1064 - 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 ':: DESC LIMIT 0, 8' at line 1 SQL=SELECT DISTINCT b.* FROM #__hikashop_product_category AS a LEFT JOIN #__hikashop_product AS b ON a.product_id=b.product_id WHERE b.product_published=1 AND b.product_type = 'main' AND a.category_id IN (39,97,16,115,29,31,34,50,51,52,78,77,75,74,76,79,84,83,82,87,88,89,91,93,94,92,95,98,99,100,101,102,103,106,114,108,109,116,117,118,119,120,123,124,127,126,128,2) AND b.product_quantity!=0 AND (b.product_access = 'all' OR b.product_access LIKE '%,9,%') ORDER BY 30:: DESC LIMIT 0, 8
I get several SQL errors on different Filters. Some work fine, others don't (see Error message above). Can't figure out what's wrong?
Please Log in or Create an account to join the conversation.
10 years 3 months ago #246181
by nicolas
Replied by nicolas on topic SQL error message on filters
Hi,
Could you provide a link to the page with the filter so that we could reproduce the problem ?
Because we don't have the problem on our end with a filter configured like that.
What you could try changing is the code:
to:
in the file administrator/components/com_hikashop/classes/filter.php
Could you provide a link to the page with the filter so that we could reproduce the problem ?
Because we don't have the problem on our end with a filter configured like that.
What you could try changing is the code:
Code:
if(!empty($case)){
$select2.=' ,'.$case.' as product_'.$type.'_normalized';
if($infos[1]=='lth'){
$order= ' ORDER BY product_'.$type.'_normalized*1 ASC';
}else{
$order= ' ORDER BY product_'.$type.'_normalized*1 DESC';
}
}else{
if($infos[1]=='lth'){
$order= ' ORDER BY '.$type.' ASC';
}else{
$order= ' ORDER BY '.$type.' DESC';
}
}
Code:
if(!empty($case)){
$select2.=' ,'.$case.' as product_'.$type.'_normalized';
if($infos[1]=='lth'){
$order= ' ORDER BY product_'.$type.'_normalized*1 ASC';
}elseif($infos[1]=='ftl'){
$order= ' ORDER BY product_'.$type.'_normalized*1 DESC';
}
}else{
if($infos[1]=='lth'){
$order= ' ORDER BY '.$type.' ASC';
}elseif($infos[1]=='htl'){
$order= ' ORDER BY '.$type.' DESC';
}
}
The following user(s) said Thank You: jouwnaambord.nl
Please Log in or Create an account to join the conversation.
- jouwnaambord.nl
-
Topic Author
- Offline
Less
More
- Posts: 515
- Thank you received: 22
10 years 3 months ago #246266
by jouwnaambord.nl
Replied by jouwnaambord.nl on topic SQL error message on filters
Hi, Nicolas,
Thanks, this works fine!
Thanks, this works fine!
The following user(s) said Thank You: nicolas
Please Log in or Create an account to join the conversation.
Time to create page: 0.042 seconds