Forums / General Questions / 1054 Unknown column 'o.orders_id' in 'on clause' -- in admin order search

1054 Unknown column 'o.orders_id' in 'on clause' -- in admin order search

Locked

Started by rxalex on 4 May 2010, 10:11 PM · Views: 1,714

Results 1 to 15 of 15
This thread is locked. New replies are disabled.
4 May 2010, 10:11 PM
#1
rxalex avatar

rxalex

Totally Zenned

Join Date:
Feb 2006
Posts:
588
Plugin Contributions:
0

1054 Unknown column 'o.orders_id' in 'on clause' -- in admin order search

I have this error coming up when I search in customer orders by item name or item model

1054 Unknown column 'o.orders_id' in 'on clause'
in:
[select count(distinct o.orders_id) as total from (zen_orders o, zen_orders_status s left join zen_orders_products op on (op.orders_id = o.orders_id) ) left join zen_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 '%098590%' or op.products_name like '098590%')]
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.

4 May 2010, 11:14 PM
#3
rxalex avatar

rxalex

Totally Zenned

Join Date:
Feb 2006
Posts:
588
Plugin Contributions:
0

Re: 1054 Unknown column 'o.orders_id' in 'on clause' -- in admin order search

Thanks tony no more error but search doesnt find anything at all.

4 May 2010, 11:18 PM
#4
drbyte avatar

drbyte

Sensei

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

Re: 1054 Unknown column 'o.orders_id' in 'on clause' -- in admin order search

When did this "start" for you?

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

5 May 2010, 2:04 AM
#5
rxalex avatar

rxalex

Totally Zenned

Join Date:
Feb 2006
Posts:
588
Plugin Contributions:
0

Re: 1054 Unknown column 'o.orders_id' in 'on clause' -- in admin order search

Dr it started when I installed click and ship Im guessing because thats the mod that changes order.php.. But cant find orders by product name if I dont remember the customers name or order number, Drbyte is there a way to fix this search in admin to work?

5 May 2010, 2:17 AM
#6
drbyte avatar

drbyte

Sensei

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

Re: 1054 Unknown column 'o.orders_id' in 'on clause' -- in admin order search

The symptoms you describe are strongly similar to putting an old version of orders.php over a newer version.

You'll need to put the newer one back up, and then merge just the unique additions/changes for the addon that replaced it.

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

5 May 2010, 2:31 AM
#7
rxalex avatar

rxalex

Totally Zenned

Join Date:
Feb 2006
Posts:
588
Plugin Contributions:
0

Re: 1054 Unknown column 'o.orders_id' in 'on clause' -- in admin order search

Oh :( my php is not so good....

5 May 2010, 8:55 AM
#8
tony_sar avatar

tony_sar

Totally Zenned

Join Date:
Jul 2006
Location:
Montreal, Canada
Posts:
2,276
Plugin Contributions:
0

Re: 1054 Unknown column 'o.orders_id' in 'on clause' -- in admin order search

you don't need much php knowledge for merging files.
if your OS is window , then download and install free tool called winmerge . this tool allow you to compare files with one anther and merge differences.

using this tool , compare the fresh copy of order.php with order.php that comes with addon . you can see the differences highlighted by this utility. simply copy the difference from addon to zencart order.php file ( done from winmerge window ) .

8 May 2010, 3:24 PM
#9
rxalex avatar

rxalex

Totally Zenned

Join Date:
Feb 2006
Posts:
588
Plugin Contributions:
0

Re: 1054 Unknown column 'o.orders_id' in 'on clause' -- in admin order search

Actually even if I put back the original orders.php file, the search function always comes back as zero result

8 May 2010, 6:57 PM
#10
drbyte avatar

drbyte

Sensei

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

Re: 1054 Unknown column 'o.orders_id' in 'on clause' -- in admin order search

rxalex:

Actually even if I put back the original orders.php file, the search function always comes back as zero result
The search on a clean install without mods properly locates orders when putting customer names in the Search box, and product names or product models in the products search box, and orders when putting the order number in the Order Number search box.

Have you tried searching using upper/lower case? Maybe you've got a case-sensitivity problem?

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

8 May 2010, 7:30 PM
#11
rxalex avatar

rxalex

Totally Zenned

Join Date:
Feb 2006
Posts:
588
Plugin Contributions:
0

Re: 1054 Unknown column 'o.orders_id' in 'on clause' -- in admin order search

Your right it is case sensitive, good job (master trouble shooter). Anyway to fix this?

12 May 2010, 1:40 AM
#12
drbyte avatar

drbyte

Sensei

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

Re: 1054 Unknown column 'o.orders_id' in 'on clause' -- in admin order search

  1. Find out what collation your database is presently using, by following the dialog here: http://www.zen-cart.com/forum/showthread.php?p=874535

It sounds like your database is set to use a case-sensitive collation, instead of a case-insensitive collation (denoted by a _ci suffix).

  1. Use the suggested changes to as an example to adjust your database's collation to a suitable mode based on your current collation.
    DO NOT CHANGE THE BASE COLLATION (ie: if it's latin1_something, change it to a latin1_something_ci ... DO NOT change it from latin1_something to utf8_something_ci, as that will create serious problems if you don't follow a whole bunch of other important steps.

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

12 May 2010, 2:36 AM
#13
rxalex avatar

rxalex

Totally Zenned

Join Date:
Feb 2006
Posts:
588
Plugin Contributions:
0

Re: 1054 Unknown column 'o.orders_id' in 'on clause' -- in admin order search

My sql looks like as attached... Can you assist me in what exactly needs to be patched . Appreciate your help, zencart was installed via simplescript - I have two sites hopefully your fix will work for both v1.3.8

12 May 2010, 3:13 AM
#14
drbyte avatar

drbyte

Sensei

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

Re: 1054 Unknown column 'o.orders_id' in 'on clause' -- in admin order search

Oh my ... why do you have a mix of both latin1_swedish_ci and utf8_bin ?

In the case of your immediate search issue, use what I posted in that thread. It will set your utf8_bin fields to utf8_general_ci which will resolve the immediate problem.

As to all your other tables being a mishmash of collations, I recommend you work with someone to clean things up to be consistent. That's an entirely different topic, and will require working with someone with the specific skills needed. Perhaps for hire.

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

12 May 2010, 3:30 AM
#15
rxalex avatar

rxalex

Totally Zenned

Join Date:
Feb 2006
Posts:
588
Plugin Contributions:
0

Re: 1054 Unknown column 'o.orders_id' in 'on clause' -- in admin order search

Thanks Doc... what exactly needs to be done so I can have them fix it?