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

#   Error: 1064 when click serial button in frontend

##

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

Less More

- Posts: 57
- Thank you received: 0
-
-

10 years 8 months ago -  10 years 8 months ago [\#234002](#234002) by [skyfranky](/forum/user/41614-skyfranky "View skyfranky's Profile")  *[Error: 1064 when click serial button in frontend](/forum/19-hikamarket/883271-error-1064-when-click-serial-button-in-frontend#234002 "-- HikaShop version -- : latest -- HikaMarket version -- : latest  Error: 1064 when click serial button in frontend   screencast.com/t/sqWUwK9g2E  Error: 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 ') OR (serial.serial&#95;pack&#95;id IN (1) AND hk&#95;order.order&#95;type = 'subsale' AND hk&#95;or' at line 1 SQL=SELECT COUNT(serial.serial&#95;id) as count, serial.serial&#95;pack&#95;id, serial.serial&#95;status FROM jos&#95;hikaserial&#95;serial AS serial LEFT JOIN jos&#95;hikashop&#95;order AS hk&#95;order ON (serial.serial&#95;order&#95;id &gt; 0 AND serial.serial&#95;order&#95;id = hk&#95;order.order&#95;parent&#95;id) WHERE serial.serial&#95;pack&#95;id IN () OR (serial.serial&#95;pack&#95;id IN (1) AND hk&#95;order.order&#95;type = 'subsale' AND hk&#95;order.order&#95;vendor&#95;id = 2) GROUP BY serial.serial&#95;pack&#95;id, serial.serial&#95;status;  PHP Version 5.5.33 joomla 3.4 mysql 5.5.32")* was created by *[skyfranky](/forum/user/41614-skyfranky "View skyfranky's Profile")*

-- HikaShop version -- : latest
-- HikaMarket version -- : latest

Error: 1064 when click serial button in frontend
[ screencast.com/t/sqWUwK9g2E](http://screencast.com/t/sqWUwK9g2E)

Error: 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 ') OR (serial.serial_pack_id IN (1) AND hk_order.order_type = 'subsale' AND hk_or' at line 1 SQL=SELECT COUNT(serial.serial_id) as count, serial.serial_pack_id, serial.serial_status FROM jos_hikaserial_serial AS serial LEFT JOIN jos_hikashop_order AS hk_order ON (serial.serial_order_id &gt; 0 AND serial.serial_order_id = hk_order.order_parent_id) WHERE serial.serial_pack_id IN () OR (serial.serial_pack_id IN (1) AND hk_order.order_type = 'subsale' AND hk_order.order_vendor_id = 2) GROUP BY serial.serial_pack_id, serial.serial_status;

PHP Version 5.5.33
joomla 3.4
mysql 5.5.32

Last edit: 10 years 8 months ago by [skyfranky](/forum/user/41614-skyfranky "View skyfranky's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzE5LWhpa2FtYXJrZXQvODgzMjcxLWVycm9yLTEwNjQtd2hlbi1jbGljay1zZXJpYWwtYnV0dG9uLWluLWZyb250ZW5kP3RtcGw9bWFya2Rvd24=) 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: 4081
-
- [](http://obsi.dev)
-

10 years 8 months ago [\#234021](#234021) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Error: 1064 when click serial button in frontend](/forum/19-hikamarket/883271-error-1064-when-click-serial-button-in-frontend#234021 "-- HikaShop version -- : latest -- HikaMarket version -- : latest  Error: 1064 when click serial button in frontend   screencast.com/t/sqWUwK9g2E  Error: 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 ') OR (serial.serial&#95;pack&#95;id IN (1) AND hk&#95;order.order&#95;type = 'subsale' AND hk&#95;or' at line 1 SQL=SELECT COUNT(serial.serial&#95;id) as count, serial.serial&#95;pack&#95;id, serial.serial&#95;status FROM jos&#95;hikaserial&#95;serial AS serial LEFT JOIN jos&#95;hikashop&#95;order AS hk&#95;order ON (serial.serial&#95;order&#95;id &gt; 0 AND serial.serial&#95;order&#95;id = hk&#95;order.order&#95;parent&#95;id) WHERE serial.serial&#95;pack&#95;id IN () OR (serial.serial&#95;pack&#95;id IN (1) AND hk&#95;order.order&#95;type = 'subsale' AND hk&#95;order.order&#95;vendor&#95;id = 2) GROUP BY serial.serial&#95;pack&#95;id, serial.serial&#95;status;  PHP Version 5.5.33 joomla 3.4 mysql 5.5.32")*

Hi,

Thanks for the report.
It looks like the user do not have any pack and it generates that SQL error.

The easier would be to edit the file "components/com_hikaserials/views/serialsmarket/view.html.php"
And to replace Code:

if($target_vendor_id == 0) { $query = 'SELECT COUNT(serial.serial_id) as count, serial.serial_pack_id, serial.serial_status FROM '.hikaserial::table('serial').' AS serial '. ' WHERE serial.serial_pack_id IN ('.implode(',', $pack_ids).') '. ' GROUP BY serial.serial_pack_id, serial.serial_status;'; } else {

By Code:

if($target_vendor_id == 0) { $query = 'SELECT COUNT(serial.serial_id) as count, serial.serial_pack_id, serial.serial_status FROM '.hikaserial::table('serial').' AS serial '. ' WHERE serial.serial_pack_id IN ('.implode(',', $pack_ids).') '. ' GROUP BY serial.serial_pack_id, serial.serial_status;'; } else { if(empty($own_packs)) $own_packs = array(0);

It would avoid the SQL issue.
I will improve the patch in order to display a message to the user instead of displaying an "empty" page.

Regards,

---

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

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

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

Less More

- Posts: 57
- Thank you received: 0
-
-

10 years 7 months ago [\#234042](#234042) by [skyfranky](/forum/user/41614-skyfranky "View skyfranky's Profile")  Replied by *[skyfranky](/forum/user/41614-skyfranky "View skyfranky's Profile")* on topic *[Error: 1064 when click serial button in frontend](/forum/19-hikamarket/883271-error-1064-when-click-serial-button-in-frontend#234042 "-- HikaShop version -- : latest -- HikaMarket version -- : latest  Error: 1064 when click serial button in frontend   screencast.com/t/sqWUwK9g2E  Error: 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 ') OR (serial.serial&#95;pack&#95;id IN (1) AND hk&#95;order.order&#95;type = 'subsale' AND hk&#95;or' at line 1 SQL=SELECT COUNT(serial.serial&#95;id) as count, serial.serial&#95;pack&#95;id, serial.serial&#95;status FROM jos&#95;hikaserial&#95;serial AS serial LEFT JOIN jos&#95;hikashop&#95;order AS hk&#95;order ON (serial.serial&#95;order&#95;id &gt; 0 AND serial.serial&#95;order&#95;id = hk&#95;order.order&#95;parent&#95;id) WHERE serial.serial&#95;pack&#95;id IN () OR (serial.serial&#95;pack&#95;id IN (1) AND hk&#95;order.order&#95;type = 'subsale' AND hk&#95;order.order&#95;vendor&#95;id = 2) GROUP BY serial.serial&#95;pack&#95;id, serial.serial&#95;status;  PHP Version 5.5.33 joomla 3.4 mysql 5.5.32")*

fix works, thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzE5LWhpa2FtYXJrZXQvODgzMjcxLWVycm9yLTEwNjQtd2hlbi1jbGljay1zZXJpYWwtYnV0dG9uLWluLWZyb250ZW5kP3RtcGw9bWFya2Rvd24=) 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?

Moderators: [Obsidev](/forum/user/7040-obsidev "View Obsidev's Profile")

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

Time to create page: 0.050 seconds

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