Forums / General Questions / Strange MYSQL error in my logs, who out there is good enough to solve?

Strange MYSQL error in my logs, who out there is good enough to solve?

Started by pearcestephens on 31 Jan 2013, 6:58 AM · Views: 716

Results 1 to 2 of 2
31 Jan 2013, 6:58 AM
#1
pearcestephens avatar

pearcestephens

New Zenner

Join Date:
Nov 2012
Posts:
69
Plugin Contributions:
0

Strange MYSQL error in my logs, who out there is good enough to solve?

Hi Guys,

I am getting houndreds of error logs filled with this stupid message, can any of you guys decipher what it means

[31-Jan-2013 19:52:37] PHP Fatal 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 '' at line 9 :: select pd.products_name, p.products_model, p.products_image, p.products_quantity,  p.products_id, p.products_type, p.master_categories_id, p.manufacturers_id, m.manufacturers_name,  p.products_price, p.products_tax_class_id, pd.products_description, if(s.status = 1, s.specials_new_products_price, NULL) AS specials_new_products_price, IF(s.status = 1, s.specials_new_products_price, p.products_price) as final_price, p.products_sort_order, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status

       from products p left join specials s on p.products_id = s.products_id , products_description pd, manufacturers m, products_to_categories p2c

       where p.products_status = 1

         and p.manufacturers_id = m.manufacturers_id

         and m.manufacturers_id = '12'

         and p.products_id = p2c.products_id

         and pd.products_id = p2c.products_id

         and pd.language_id = '1'

         and p2c.categories_id = '173' order by  in /home/frankton/public_html/shopping.franktonmodels.co.nz/includes/classes/db/mysql/query_factory.php on line 120

My query factory file is default and untouched!

Any help would be great because I dont have a clue where to start

31 Jan 2013, 7:06 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: Strange MYSQL error in my logs, who out there is good enough to solve?

query-factory is only the messenger.

The culprit is whatever piece of PHP code built the query that got passed to query-factory for submission to the database.

In this case your "order by" clause is missing any operands, hence the "unexpected '' " in the error message. You will need to find the code that's building a bad query.

So ... let's start with a thorough detailed list of all the ways in which your site is different from original Zen Cart code, including plugins, changed files, everything. Therein is most likely the answer to your problem. And thus so also is this: http://www.zen-cart.com/wiki/index.php/Troubleshoot_-_Diagnosing_Obscure_Issues

.
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.