Forums / General Questions / 1054 Unknown column 'o.orders_id' in 'on clause'

1054 Unknown column 'o.orders_id' in 'on clause'

Locked

Views: 8,908

Results 21 to 33 of 33
This thread is locked. New replies are disabled.
3 Mar 2008, 4:19 PM
#21
fergusmacdonald avatar

fergusmacdonald

Zen Follower

Join Date:
Oct 2007
Location:
Edinburgh, Scotland
Posts:
243
Plugin Contributions:
0

1054 Unknown column 'o.orders_id' in 'on clause'

Has anyone found a solution to this problem yet? I've tried the code changes outlined and it still doesn't work.

Thanks,
Fergus

3 Mar 2008, 5:30 PM
#22
michaelhl avatar

michaelhl

New Zenner

Join Date:
Oct 2005
Location:
Germany
Posts:
60
Plugin Contributions:
0

Re: 1054 Unknown column 'o.orders_id' in 'on clause'

Hi,
There is no solution until now. It seems that not everybody has this problem and so it is hard for the developers to solve this mistake.
I can live without using this feature.

3 Mar 2008, 7:03 PM
#23
drbyte avatar

drbyte

Sensei

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

Re: 1054 Unknown column 'o.orders_id' in 'on clause'

If you're having this problem, please post the following information:

  • version of Zen Cart
  • list of addons/contributions installed
  • version of PHP
  • version of MySQL
  • whether hosted on linux vs windows
  • example search-term which triggers the error
  • and please confirm that you're only getting this error when doing a search using the "Search by Product Name or ID:XX or Model" field. If there are other places, that information is important as well.

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

3 Mar 2008, 7:12 PM
#24
fergusmacdonald avatar

fergusmacdonald

Zen Follower

Join Date:
Oct 2007
Location:
Edinburgh, Scotland
Posts:
243
Plugin Contributions:
0

Re: 1054 Unknown column 'o.orders_id' in 'on clause'

Details:

Zen Cart Version: 1.3.8a
Add-ons installed: Super Orders 2.0, Admin Notes file, Big Royal Mail 2.2.1a1, Capitalize Signup Fields 1.0b, Categories Menu Yahoo Tree Menu with Ajax, Fual Slimbox v0.1.5, Ultimate SEO URL's 2.106.
PHP Version: 5.1.6 (Zend: 2.1.0)
MySQL Version: 5.0.54
Hosted On: Linux
Example: Royal

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 = '1' and ot.class = 'ot_total') and (op.products_model like '%Royal%' or op.products_name like 'Royal%')]

I've tried a number of searches and get this error every time, only from the "Search by Product Name or ID:XX or Model" box, the standard "Search" box and Order ID searches work fine.

3 Mar 2008, 7:15 PM
#25
drbyte avatar

drbyte

Sensei

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

Re: 1054 Unknown column 'o.orders_id' in 'on clause'

fergusmacdonald:

Add-ons installed: Super Orders 2.0And is this happening when using the Super Orders interface?

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

3 Mar 2008, 7:26 PM
#26
fergusmacdonald avatar

fergusmacdonald

Zen Follower

Join Date:
Oct 2007
Location:
Edinburgh, Scotland
Posts:
243
Plugin Contributions:
0

Re: 1054 Unknown column 'o.orders_id' in 'on clause'

DrByte:

And is this happening when using the Super Orders interface?

No, the Super Orders interface does not have a "Search by Product Name or ID:XX or Model" field.

On the regular Customers>Orders page.

3 Mar 2008, 7:57 PM
#27
drbyte avatar

drbyte

Sensei

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

Re: 1054 Unknown column 'o.orders_id' in 'on clause'

In the /admin/orders.php, from lines 715 thru 750 there are three places where the following is found:from (" . TABLE_ORDERS . " o, " . TABLE_ORDERS_STATUS . " s " .change each of those to this instead:```
from (" . TABLE_ORDERS_STATUS . " s, " .
TABLE_ORDERS . " o " .

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

4 Mar 2008, 11:22 AM
#28
fergusmacdonald avatar

fergusmacdonald

Zen Follower

Join Date:
Oct 2007
Location:
Edinburgh, Scotland
Posts:
243
Plugin Contributions:
0

Re: 1054 Unknown column 'o.orders_id' in 'on clause'

Fantastic, thank you very much - the problem is solved. Search box working properly.

4 Mar 2008, 8:07 PM
#29
dbrewster avatar

dbrewster

Zen Follower

Join Date:
Jul 2005
Location:
Charlottesville, VA
Posts:
376
Plugin Contributions:
0

Re: 1054 Unknown column 'o.orders_id' in 'on clause'

Rock on, Dr. Byte!

Works like a charm, thank you!!

15 Sep 2009, 2:36 PM
#30
helpme avatar

helpme

Totally Zenned

Join Date:
Apr 2007
Posts:
632
Plugin Contributions:
0

Re: 1054 Unknown column 'o.orders_id' in 'on clause'

That works great, but as soon as I did that now I can not view an order from customers>customers>orders I get this 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 '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, o.fedex_tracking, 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 (orders_status s, orders o ) left join orders_total ot on (o.orders_id = ot.orders_id) where o.customers_id = '1310' 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.
any ideas?? thanks!

5 May 2010, 11:51 PM
#31
simondale123 avatar

simondale123

New Zenner

Join Date:
Jun 2008
Posts:
60
Plugin Contributions:
0

Re: 1054 Unknown column 'o.orders_id' in 'on clause'

I have the same thing as helpme. I made the fix from DrByte (a thousand thankyous to you, Sir) but now I cannot now go customers (and select a customer) and then press the orders button under that customer. I get the following 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 '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 (orders_status s, orders o ) left join orders_total ot on (o.orders_id = ot.orders_id) where o.customers_id = '302' 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.

I use Zen Cart v1.3.8. Any help would be very gratefully received.

Thanks

Simon

6 May 2010, 12:12 AM
#32
drbyte avatar

drbyte

Sensei

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

Re: 1054 Unknown column 'o.orders_id' in 'on clause'

Several things related to the original problem were fixed in v1.3.9. Please upgrade to obtain those benefits and for compatibility with the newer MySQL versions.

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

11 Jun 2010, 6:43 AM
#33
simondale123 avatar

simondale123

New Zenner

Join Date:
Jun 2008
Posts:
60
Plugin Contributions:
0

Re: 1054 Unknown column 'o.orders_id' in 'on clause'

Thanks for your reply Dr Dyte.

Does upgrading mean starting again and rewriting my template to fit the new Zen Cart or is it simpler than that?

All the best

Simon