Zen Cart Logo
Forums / General Questions / Error 1064 when searching customers orders

Error 1064 when searching customers orders

Views: 854

Results 1 to 4 of 4
15 Feb 2011, 11:08 PM
#1
edvon avatar

edvon

New Zenner

Join Date:
Aug 2009
Posts:
26
Plugin Contributions:
0

Error 1064 when searching customers orders

Hi all,
my first post... using 1.3.8, I use stock by attributes and a sidebox addon. I recently altered orders.php because I couldn't search for a product id in all orders, that's been fixed, but now when I look for a customers orders I get:

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 'select o.orders_id, o.customers_id, o.customers_name, o.payment_method, o.shippi' at line 1
in:
[select count(*) as total select o.orders_id, o.customers_id, o.customers_name, o.payment_method, o.shipping_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total, o.customers_company, o.customers_email_address, o.customers_street_address, o.delivery_company, o.delivery_name, o.delivery_street_address, o.billing_company, o.billing_name, o.billing_street_address, o.payment_module_code, o.shipping_module_code, o.ip_address from (zen_orders_status s, zen_orders o ) left join zen_orders_total ot on (o.orders_id = ot.orders_id) where o.customers_id = '8' and o.orders_status = s.orders_status_id and s.language_id = '1' and ot.class = 'ot_total']
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

did a search but havnen't found nothing in the forums. how would I go about searching for the file that could have the error?

thanks, Edvon

18 Feb 2011, 12:53 AM
#2
edvon avatar

edvon

New Zenner

Join Date:
Aug 2009
Posts:
26
Plugin Contributions:
0

Re: Error 1064 when searching customers orders

here is the changes I made to the orders.php file:

before:
$new_fields . "
from (" . TABLE_ORDERS_STATUS . " s, " .
TABLE_ORDERS . " o " .

after:

                        $new_fields . "
                        from (" . TABLE_ORDERS . " o, " .
                        TABLE_ORDERS_STATUS . " s " .

before:
$new_fields . "
from (" . TABLE_ORDERS_STATUS . " s, " .
TABLE_ORDERS . " o " .

after:
$new_fields . "
from (" . TABLE_ORDERS . " o, " .
TABLE_ORDERS_STATUS . " s " .

before:
$new_fields . "
from (" . TABLE_ORDERS_STATUS . " s, " .
TABLE_ORDERS . " o " .

after:

                      $new_fields . "
                      from (" . TABLE_ORDERS . " o, " .
                      TABLE_ORDERS_STATUS . " s " .

Hope this might help to fix?

Edvon

21 Feb 2011, 6:08 AM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Error 1064 when searching customers orders

Better would be to upgrade to the latest version where all known bugs are fixed.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

1 Mar 2011, 9:29 PM
#4
edvon avatar

edvon

New Zenner

Join Date:
Aug 2009
Posts:
26
Plugin Contributions:
0

Re: Error 1064 when searching customers orders

Thanks Dr. Byte,

yes, about upgrading I am a little apprehensive, but I suppose it makes sense. Any pointers to threads about upgrading and what to look out for when doing so? Will all my mods (stock by attributes, sideboxes) be "remembered" after the upgrade?

Edvon