Post by Need2Clean Admin » Wed Jan 24, 2018 6:35 pm

Hi Community,

Has anybody got any insight into an error I am experiencing. I am building a website in OpenCart 2.3.0.2 and whilst the website is working fine, I have recently found that when you have products over more than 1 category page, I can for example click on the navigation button at the bottom of a category (page 2, next page or last page buttons) and it works absolutely fine or but once on page 2, if I reverse the process (i.e. Page 1, Previous or First Page butttons), I get the following error.

Code: Select all

Fatal error: Uncaught Exception: Error: 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 '-15, 15' at line 1<br />Error No: 1064<br /> SELECT p.product_id, p.sort_order, "1" AS match_filters, pp.sort_order FROM `oc_product` AS p INNER JOIN `oc_product_to_store` AS p2s ON (p2s.product_id = p.product_id) INNER JOIN `oc_bf_filter` AS f ON (p.product_id = f.product_id) INNER JOIN `oc_product_to_category` AS p2c ON (p.product_id = p2c.product_id) INNER JOIN `oc_product_description` AS pd ON (pd.product_id = p.product_id) INNER JOIN `oc_product` AS pp ON (pp.product_id = p.product_id) WHERE p2s.store_id = '0' AND p.date_available <= NOW() AND p2c.category_id = '102' AND pd.language_id = '1' GROUP BY p.product_id HAVING match_filters = 1 ORDER BY pp.sort_order ASC, pd.name ASC LIMIT -15, 15 in /homepages/24/d163902889/htdocs/hutchings_direct/system/library/db/mysqli.php:40 Stack trace: #0 /homepages/24/d163902889/htdocs/hutchings_direct/system/l in /homepages/24/d163902889/htdocs/hutchings_direct/system/library/db/mysqli.php on line [b]40
Clicking on the back button on my browser works fine however.

I'm stumped, anybody experienced this problem and can suggest how I rectify it? Any help would be very much appreciated.


Posts

Joined
Wed May 17, 2017 11:52 pm


Post by thekrotek » Wed Jan 24, 2018 6:41 pm

The error tells you everything: there's an error in MySQL query, LIMIT can't be -15, 15. Some of your extensions doesn't reset the starting point, if its value is below zero.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by Need2Clean Admin » Wed Jan 24, 2018 8:02 pm

Hi There,
Thank you for the insight, you're quite right it is all there! I have narrowed it down to a particular module - Brainy Filter - that is causing the issue. I have another website I maintain using OC 2.0.3.1 and an earlier version of Brainy Filter that doesn't have the problem, so I'm guessing it's a bug in the code for the OC 2.3.0.2 version of the module.


Posts

Joined
Wed May 17, 2017 11:52 pm


Post by paulfeakins » Thu Jan 25, 2018 6:26 pm

Yes, contact the extension developer.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by Need2Clean Admin » Thu Jan 25, 2018 10:26 pm

Actually guys, it has nothing to do with the Brainy Filter module. I contacted the developer of Brainy Filter and he rapidly got back to me with the answer. It is actually a bug introduced introduced from OC 2.2+. It relates to a syntax error in the pagination.php in the system/library folder.
If you replace the pagination.php with the one from here https://github.com/ThemeBurn/OpenCart-E ... nation.php it cures the problem. It is to do with havin SEO friendly urls enabled in server settings.


Posts

Joined
Wed May 17, 2017 11:52 pm


Post by fnw » Tue Mar 13, 2018 9:43 pm

Hello,
i have this error how i can fix it :
Fatal error: 'Error: 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 ' address_1 = 'Al iradah street building no 7212 -', address_2 = '', city = 'jedd' at line 1
Error No: 1064
INSERT INTO oc_address SET customer_id = '23', firstname = 'fatmah', lastname = 'abusadah',, address_1 = 'Al iradah street building no 7212 -', address_2 = '', city = 'jeddah', postcode = '23336', country_id = '184', zone_id = '2884', custom_field = '''
in /home7/eadescom/public_html/system/library/db/mysqli.php:40
Stack trace:
#0 system/storage/modification/system/library/db.php(30): DB\MySQLi->query('INSERT INTO oc_...', Array)
#1 catalog/model/account/customer.php(18): DB->query('INSERT INTO oc_...')
#2 [internal function]: ModelAccountCustomer->addCustomer(Array)
#3 vqmod/vqcache/vq2-system_storage_modification_system_engine_loader.php(175): call_user_func_array(Array, Array)
#4 [internal function]: Loader->{closure}(Array)
#5 system/engine/proxy.php(13): call_user_func(Object(Closure), Array)
#6 catalog/controller/account/register.php(21): Proxy->__call('addCustomer', Array)
#7 catalog/controller/account/register.php(21): Proxy->addCustomer(Array)
#8 [internal function]: ControllerAccountRegister->index()
#9 vqmod/vqcache/vq2-system_storage_modification_system_engine_action.php(44): call_user_func_array(Array, Array)
#10 catalog/controller/startup/router.php(25): Action->execute(Object(Registry))
#11 [internal function]: ControllerStartupRouter->index()
#12 vqmod/vqcache/vq2-system_storage_modification_system_engine_action.php(44): call_user_func_array(Array, Array)
#13 system/engine/front.php(34): Action->execute(Object(Registry))
#14 system/engine/front.php(29): Front->execute(Object(Action))
#15 system/framework.php(99): Front->dispatch(Object(Action), Object(Action))
#16 index.php(26): require_once('/home7/eadescom...')
#17 {main}

fnw
Newbie

Posts

Joined
Sun Feb 25, 2018 5:58 pm

Post by thekrotek » Thu Mar 15, 2018 5:06 am

Some of your extension has a wrong database query. Error is in double comma before address_1 field:

INSERT INTO oc_address SET customer_id = '23', firstname = 'fatmah', lastname = 'abusadah',, address_1 = 'Al iradah street building no 7212 -', address_2 = '', city = 'jeddah', postcode = '23336', country_id = '184', zone_id = '2884', custom_field = ''

Find extension, which produces this error and fix it yourself or contact extension developer.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am

Who is online

Users browsing this forum: No registered users and 280 guests