Post by REW » Wed Oct 26, 2016 7:07 am

I'm getting an error on checkout:

Fatal error: Uncaught exception 'ErrorException' with message '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 'order WHERE order_id = '3612'' at line 1<br />
Error No: 1064<br />SELECT total FROM order WHERE order_id = '3612'' in /home/path/shop.ourshop.com/system/database/mysqli.php:41
Stack trace: #0 /home/path/shop.ourshop.com/vqmod/vqcache/vq2-system_library_db.php(20): DBMySQLi->query('SELECT total FR...')
#1 /home/path/shop.ourshop.com/vqmod/vqcache/vq2-catalog_controller_common_header.php(225): DB->query('SELECT total FR...')
#2 /home/path/shop.ourshop.com/vqmod/vqcache/vq2-system_engine_controller.php(43): ControllerCommonHeader->index(Array)
#3 /home/path/shop.ourshop.com/vqmod/vqcache/vq2-system_engine_controller.php(74): Controller->getChild('common/header')
#4 /home/path/shop.ourshop.com/vqmod/vqcache/vq2-catalog_controller_checkout_success.php(162): Controller->render()
#5 [internal function]: in /home/path/shop.ourshop.com/system/database/mysqli.php on line 41


Searching shows others with this error, but I'm not seeing them as related to checkout. I was hoping someone could shed some light on it, to at least get me going in the right direction. Thank you!

edit: It should be noted that the last and only thing I've done recently was to change the store's email. We were using Mandrill and dropped it. Now setup with a simple sendmail using a email address us@ourserver.com. It worked fine, sending mail form the contact form, and no error on checkout. The error above then showed up today, seemingly at random.

REW
New member

Posts

Joined
Wed Feb 25, 2015 4:00 am

Post by imdevlper18 » Wed Oct 26, 2016 1:36 pm

The problem is syntax.
Your code:

Code: Select all

order WHERE order_id = '3612'
Make it:

Code: Select all

`order` WHERE `order_id` = '3612'

Opencart Extensions | Professional opencart support | Support Ticket | support@cartbinder.com


User avatar
Active Member

Posts

Joined
Sun May 11, 2014 2:04 pm

Post by REW » Fri Oct 28, 2016 5:38 am

Thanks imdevlper18

I ran a search for order "WHERE order_id exists" and found it in only one file,
\admin\model\payment\pp_payflow_iframe.php

On line 40 it reads:

$result = $this->db->query("SELECT * FROM " . DB_PREFIX . "paypal_payflow_iframe_order WHERE order_id = " . (int)$order_id);

I'm not sure if this is the right file (not sure why paypal would be involved, we aren't using it at all), or what to do with the line of code specifically.

Sorry, I'm out of my element here. If anyone wants to chime in that'd be great.

REW
New member

Posts

Joined
Wed Feb 25, 2015 4:00 am

Post by artcore » Fri Oct 28, 2016 3:00 pm

SELECT total FROM order WHERE order_id = '3612'' has too many quotes.
As it happens on the success page I suspect an extension or customization done by someone who didn't have their coffee yet

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands
Who is online

Users browsing this forum: Amazon [Bot] and 43 guests