Zen Cart Logo
Forums / Bug Reports / [Done 1.3.9a] Admin order.php search products SQL Error 1054

[Done 1.3.9a] Admin order.php search products SQL Error 1054

Locked

Views: 5,658

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
19 Oct 2008, 3:27 PM
#1
a_berezin avatar

a_berezin

Deceased

Join Date:
Aug 2004
Location:
Saint Petersburg, Russia
Posts:
1,782
Plugin Contributions:
5

[Done 1.3.9a] Admin order.php search products SQL Error 1054

Admin order.php when search products receiving SQL Error:
1054 Unknown column 'o.orders_id' in 'on clause'
in:
[select count(distinct o.orders_id) as total from (orders o, orders_status s left join orders_products op on (op.orders_id = o.orders_id) ) left join orders_total ot on (o.orders_id = ot.orders_id) where (o.orders_status = s.orders_status_id and s.language_id = '2' and ot.class = 'ot_total') and (op.products_model like '%ttt%' or op.products_name like 'ttt%')]

MySQL 5.1.22-rc-log
5.2.5 (Zend: 2.2.0)
Zen Cart 1.3.8a
v1.3.8 [2008-04-10 13:05:03] (Fresh Installation)
Fresh installation - no any modules.

Line 720-721, 732-733, 744-745

                            TABLE_ORDERS_STATUS . " s " .
                            $new_table . ")

replace by

                            TABLE_ORDERS_STATUS . " s )" .
                            $new_table . "

NOTE: We are sorry that Andrew is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

9 Dec 2008, 5:23 AM
#2
craft_magick avatar

craft_magick

Zen Follower

Join Date:
Nov 2007
Posts:
166
Plugin Contributions:
0

Re: [Done 1.3.9a] Admin order.php search products SQL Error 1054

I am getting a similar error when I try to search orders by product:

Here's the error message:

1054 Unknown column 'o.orders_id' in 'on clause'
in:
[select count(distinct o.orders_id) as total from (orders o, orders_status s left join orders_products op on (op.orders_id = o.orders_id) ) left join orders_total ot on (o.orders_id = ot.orders_id) where (o.orders_status = s.orders_status_id and s.language_id = '1' and ot.class = 'ot_total') and (op.products_model like '%RA181%' or op.products_name like 'RA181%')]
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.

I have no idea what this means...

any help would be appreciated

Zencart ROCKS :clap:

www.ZenCrystals.com
www.CraftMagick.com
Magickal & Metaphysical supplies/services

9 Dec 2008, 9:50 AM
#3
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: [Done 1.3.9a] Admin order.php search products SQL Error 1054

It's exactly the same problem as Andrew describes! So just apply the fix he posted, it works perfectly :thumbsup:

10 Dec 2008, 5:46 AM
#4
craft_magick avatar

craft_magick

Zen Follower

Join Date:
Nov 2007
Posts:
166
Plugin Contributions:
0

Re: [Done 1.3.9a] Admin order.php search products SQL Error 1054

paulm:

It's exactly the same problem as Andrew describes! So just apply the fix he posted, it works perfectly :thumbsup:

Thank you for your patience, paulm.

I hadn't realized his solution was something a mere mortal like me (read: non sql/php programmer) could do...

After reading your post I figured it must be something rather straight forward so decided to give it a whirl...

And for any other mere mortal newbies that may read this thread someday and :frusty: here's the way I found the solution in the most basic of terms...

  1. Searched the Admin>Dev Tool Kit for $new_table and found the code in the admin/orders.php file

  2. CREATED A BACKUP (never forget this crucial step!) of the orders.php file

  3. modified the code changes as suggested above

Viola! I can now search orders very easily :clap:

So thank you for being so compassionate and helpful. I appreciate it very much.

Zencart ROCKS :clap:

www.ZenCrystals.com
www.CraftMagick.com
Magickal & Metaphysical supplies/services

11 Dec 2008, 4:55 PM
#5
sawhorse avatar

sawhorse

Zen Follower

Join Date:
Oct 2007
Location:
Kentucky - USA
Posts:
425
Plugin Contributions:
0

Re: [Done 1.3.9a] Admin order.php search products SQL Error 1054

Interesting - However in my admin orders.php I have the following - at line 719, 731, & 743```
from (" . TABLE_ORDERS_STATUS . " s, " .
TABLE_ORDERS . " o " .
$new_table . ")


Oh, I am not receiving any errors.

Sawhorse

ZC 1.3.8a; Addons: Admin Profiles, Ty Package Tracker; Swap Images via MouseOver or Click, Smart Backgrounds; Printable Price List; CSS buttons; Contact Us - Add Subject; Template: Self Constructed; Site: http://sawhorsejewelry.com

2 Jan 2009, 8:06 AM
#6
mumzie avatar

mumzie

Inactive

Join Date:
Feb 2007
Posts:
211
Plugin Contributions:
0

Re: [Done 1.3.9a] Admin order.php search products SQL Error 1054

Thank you. this fixed my issues as well.

13 Apr 2010, 11:48 AM
#7
ningyotan avatar

ningyotan

New Zenner

Join Date:
Nov 2009
Posts:
56
Plugin Contributions:
0

Re: [Done 1.3.9a] Admin order.php search products SQL Error 1054

Thanks, it fixed mine too . . . .

Very grateful!

19 Apr 2010, 5:31 AM
#8
twinkie avatar

twinkie

New Zenner

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

Re: [Done 1.3.9a] Admin order.php search products SQL Error 1054

thank you!I think I just fixed mine too!
the search doesn't seem to work perfectly tho.
there are two search boxes.The one on the left is called "search" and the one on the right "Search by Product Name or ID:XX or Model".The latter seems to work better than the former for some reason.

The "search" box only responds to very few keywords(from the product titles).

the "Search by Product Name or ID:XX or Model" box only seems to respond to the BEGINNING of the product name, not the END of the product name.

Is anyone else having the same issue or is it just me?

(I'm using 1.3.8a as well)