[Skip to main content](#vessel-content)

#   SQL error

##

- **[Dibben](/forum/user/6788-dibben "View Dibben's Profile")**
- [![Dibben's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/6788-dibben "View Dibben's Profile") Topic Author
- [ Offline](/forum/user/6788-dibben)

Less More

- Posts: 377
- Thank you received: 7
-
-

11 years 8 months ago [\#194951](#194951) by [Dibben](/forum/user/6788-dibben "View Dibben's Profile")  *[SQL error](/forum/3-bug-report/875714-sql-error#194951 "-- url of the page with the problem -- :   www.houseoflights.co.uk/index.php/homeware/checkout  -- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4.0 -- PHP version -- : 5.4 -- Browser(s) name and version -- : Firefox -- Error-message(debug-mod must be tuned on) -- : 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 '28,29,30,)' at line 1 SQL=SELECT category&#95;left,category&#95;right FROM r8zp9&#95;hikashop&#95;category WHERE category&#95;id IN (,28,29,30,)  It seems when I do the discount code on the site that it kicks out an SQL error. I can publish the discount code section in the settings fine, but if i publish this discount (attached) then the SQL error occurs. Also it doesnt look like normal behavior, because i can select the categories which apply to that discount but after i have saved it removes them again.  Kind regards  Alex")* was created by *[Dibben](/forum/user/6788-dibben "View Dibben's Profile")*

-- url of the page with the problem -- : [ www.houseoflights.co.uk/index.php/homeware/checkout](http://www.houseoflights.co.uk/index.php/homeware/checkout)
-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.4.0
-- PHP version -- : 5.4
-- Browser(s) name and version -- : Firefox
-- Error-message(debug-mod must be tuned on) -- : 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 '28,29,30,)' at line 1 SQL=SELECT category_left,category_right FROM r8zp9_hikashop_category WHERE category_id IN (,28,29,30,)

It seems when I do the discount code on the site that it kicks out an SQL error. I can publish the discount code section in the settings fine, but if i publish this discount (attached) then the SQL error occurs. Also it doesnt look like normal behavior, because i can select the categories which apply to that discount but after i have saved it removes them again.

Kind regards

Alex

- [ ![discount&#95;bug.jpg](/forum/attachment/23134) ](/forum/attachment/23134 "discount&#95;bug.jpg") [ ](/forum/attachment/23134?download=1 "discount&#95;bug.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC84NzU3MTQtc3FsLWVycm9yP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

11 years 8 months ago [\#194964](#194964) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[SQL error](/forum/3-bug-report/875714-sql-error#194964 "-- url of the page with the problem -- :   www.houseoflights.co.uk/index.php/homeware/checkout  -- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4.0 -- PHP version -- : 5.4 -- Browser(s) name and version -- : Firefox -- Error-message(debug-mod must be tuned on) -- : 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 '28,29,30,)' at line 1 SQL=SELECT category&#95;left,category&#95;right FROM r8zp9&#95;hikashop&#95;category WHERE category&#95;id IN (,28,29,30,)  It seems when I do the discount code on the site that it kicks out an SQL error. I can publish the discount code section in the settings fine, but if i publish this discount (attached) then the SQL error occurs. Also it doesnt look like normal behavior, because i can select the categories which apply to that discount but after i have saved it removes them again.  Kind regards  Alex")*

Hello,
Can you use the "Check Database" button through the page "Hikashop-&gt;System-&gt;Configuration" and test it again ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC84NzU3MTQtc3FsLWVycm9yP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Dibben](/forum/user/6788-dibben "View Dibben's Profile")**
- [![Dibben's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/6788-dibben "View Dibben's Profile") Topic Author
- [ Offline](/forum/user/6788-dibben)

Less More

- Posts: 377
- Thank you received: 7
-
-

11 years 8 months ago [\#195035](#195035) by [Dibben](/forum/user/6788-dibben "View Dibben's Profile")  Replied by *[Dibben](/forum/user/6788-dibben "View Dibben's Profile")* on topic *[SQL error](/forum/3-bug-report/875714-sql-error#195035 "-- url of the page with the problem -- :   www.houseoflights.co.uk/index.php/homeware/checkout  -- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4.0 -- PHP version -- : 5.4 -- Browser(s) name and version -- : Firefox -- Error-message(debug-mod must be tuned on) -- : 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 '28,29,30,)' at line 1 SQL=SELECT category&#95;left,category&#95;right FROM r8zp9&#95;hikashop&#95;category WHERE category&#95;id IN (,28,29,30,)  It seems when I do the discount code on the site that it kicks out an SQL error. I can publish the discount code section in the settings fine, but if i publish this discount (attached) then the SQL error occurs. Also it doesnt look like normal behavior, because i can select the categories which apply to that discount but after i have saved it removes them again.  Kind regards  Alex")*

Sure, i did this, it said 'OK' next to all of them, i then published the discount however the problem is still there. I have unpublished again because it is a live site.

Kind regards

Alex

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC84NzU3MTQtc3FsLWVycm9yP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4080
-
- [](http://obsi.dev)
-

11 years 8 months ago [\#195043](#195043) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[SQL error](/forum/3-bug-report/875714-sql-error#195043 "-- url of the page with the problem -- :   www.houseoflights.co.uk/index.php/homeware/checkout  -- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4.0 -- PHP version -- : 5.4 -- Browser(s) name and version -- : Firefox -- Error-message(debug-mod must be tuned on) -- : 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 '28,29,30,)' at line 1 SQL=SELECT category&#95;left,category&#95;right FROM r8zp9&#95;hikashop&#95;category WHERE category&#95;id IN (,28,29,30,)  It seems when I do the discount code on the site that it kicks out an SQL error. I can publish the discount code section in the settings fine, but if i publish this discount (attached) then the SQL error occurs. Also it doesnt look like normal behavior, because i can select the categories which apply to that discount but after i have saved it removes them again.  Kind regards  Alex")*

Hi,

In the file "administrator/components/com_hikashop/classes/currency.php" please replace Code:

if(!is_array($discount-&gt;discount_category_id)) $discount-&gt;discount_category_id = explode(',',$discount-&gt;discount_category_id));

By Code:

if(!is_array($discount-&gt;discount_category_id)) $discount-&gt;discount_category_id = explode(',',trim($discount-&gt;discount_category_id, ','));

It will fix the issue

And you also replace in the file "adminstrator/components/com_hikashop/views/discount/tmpl/form_restrictions.php" Code:

explode(',',@$this-&gt;element-&gt;discount_category_id),

By Code:

explode(',', trim(@$this-&gt;element-&gt;discount_category_id, ',')),

It will fix the display of the categories while editing the discount.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

The following user(s) said Thank You: [Dibben](/forum/user/6788-dibben "View Dibben's Profile"), [van der Veen](/forum/user/35862-van-der-veen "View van der Veen's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC84NzU3MTQtc3FsLWVycm9yP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Dibben](/forum/user/6788-dibben "View Dibben's Profile")**
- [![Dibben's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/6788-dibben "View Dibben's Profile") Topic Author
- [ Offline](/forum/user/6788-dibben)

Less More

- Posts: 377
- Thank you received: 7
-
-

11 years 7 months ago [\#195409](#195409) by [Dibben](/forum/user/6788-dibben "View Dibben's Profile")  Replied by *[Dibben](/forum/user/6788-dibben "View Dibben's Profile")* on topic *[SQL error](/forum/3-bug-report/875714-sql-error#195409 "-- url of the page with the problem -- :   www.houseoflights.co.uk/index.php/homeware/checkout  -- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4.0 -- PHP version -- : 5.4 -- Browser(s) name and version -- : Firefox -- Error-message(debug-mod must be tuned on) -- : 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 '28,29,30,)' at line 1 SQL=SELECT category&#95;left,category&#95;right FROM r8zp9&#95;hikashop&#95;category WHERE category&#95;id IN (,28,29,30,)  It seems when I do the discount code on the site that it kicks out an SQL error. I can publish the discount code section in the settings fine, but if i publish this discount (attached) then the SQL error occurs. Also it doesnt look like normal behavior, because i can select the categories which apply to that discount but after i have saved it removes them again.  Kind regards  Alex")*

This is great thank you Jerome

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC84NzU3MTQtc3FsLWVycm9yP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.073 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
