Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / 1054 Unknown column 'zen_order_id' in 'where clause'

1054 Unknown column 'zen_order_id' in 'where clause'

Locked

Views: 7,781

Results 1 to 20 of 25
This thread is locked. New replies are disabled.
31 Jan 2008, 6:26 PM
#1
mtrantas avatar

mtrantas

New Zenner

Join Date:
Jan 2008
Posts:
30
Plugin Contributions:
0

1054 Unknown column 'zen_order_id' in 'where clause'

I ran a test order through my Zen Cart and after I submitted the PayPal payment I recieved this error:

1054 Unknown column 'zen_order_id' in 'where clause'
in:
[select * from paypal where zen_order_id = '2' order by paypal_ipn_id DESC LIMIT 1]

I was not returned back to my site but instead got an error message. The order is in the Admin tool and it was actually paid for but I never was returned to the site.

Does anyone know what this is and how to correct it?

31 Jan 2008, 6:54 PM
#2
mtrantas avatar

mtrantas

New Zenner

Join Date:
Jan 2008
Posts:
30
Plugin Contributions:
0

Re: 1054 Unknown column 'zen_order_id' in 'where clause'

I apologize - this is the full error:

1054 Unknown column 'zen_order_id' in 'field list'
in:
[SELECT zen_order_id, paypal_ipn_id, payment_status, txn_type, pending_reason FROM paypal WHERE txn_id = '5FR094876R425540U' OR parent_txn_id = '5FR094876R425540U' ORDER BY zen_order_id DESC ]

1 Feb 2008, 2:16 PM
#3
lead_not_follow avatar

lead_not_follow

New Zenner

Join Date:
Jan 2008
Posts:
23
Plugin Contributions:
0

Re: 1054 Unknown column 'zen_order_id' in 'where clause'

I am having the same issue when I go to view the order in the admin panel.

Here is what I am getting...

1054 Unknown column 'zen_order_id' in 'where clause'
in:
[select * from zen_paypal where zen_order_id = 2 AND parent_txn_id = '' ]
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.

Looking for an answer as well.

1 Feb 2008, 10:47 PM
#4
drbyte avatar

drbyte

Sensei

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

Re: 1054 Unknown column 'zen_order_id' in 'where clause'

You are using 1.3.7 (or older) code in your PHP files, but using a 1.3.8 version of one or more of the PayPal modules.

2 Feb 2008, 1:07 AM
#5
lead_not_follow avatar

lead_not_follow

New Zenner

Join Date:
Jan 2008
Posts:
23
Plugin Contributions:
0

Re: 1054 Unknown column 'zen_order_id' in 'where clause'

DrByte:

You are using 1.3.7 (or older) code in your PHP files, but using a 1.3.8 version of one or more of the PayPal modules.
Can you explain it for the un-educated more?

I have not done any upgrades at all. Do I need to?

How do I fix the problem? Can I just use a 1.3.7 paypal module to resolve the problem? I apologize as I'm a total newbie to this.

2 Feb 2008, 3:40 AM
#6
drbyte avatar

drbyte

Sensei

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

Re: 1054 Unknown column 'zen_order_id' in 'where clause'

What version of Zen Cart are you using?
How did you install it?
Have you applied any patches to it?
What addons/contributions do you have installed?

2 Feb 2008, 4:24 PM
#7
lead_not_follow avatar

lead_not_follow

New Zenner

Join Date:
Jan 2008
Posts:
23
Plugin Contributions:
0

Re: 1054 Unknown column 'zen_order_id' in 'where clause'

DrByte:

You are using 1.3.7 (or older) code in your PHP files, but using a 1.3.8 version of one or more of the PayPal modules.

DrByte:

What version of Zen Cart are you using?
How did you install it?
Have you applied any patches to it?
What addons/contributions do you have installed?

Here is the info:

*Server Host: linhost194.prod.mesa1.secureserver.net (68.178.232.150) Database Host: h50mysql45.secureserver.net (10.8.11.214)
Server OS: Linux 2.4.21-40.ELsmp
Database: MySQL 5.0.45-log
Server Date: 02/02/2008 09:18:40
Database Date: 02/02/2008 09:18:40
Server Up Time: 09:18:40 up 206 days, 15:21, 0 users, load average: 9.25, 8.34, 7.86
PHP Version: 4.3.11 (Zend: 1.3.0)
HTTP Server: Apache

Zen Cart 1.3.7
Database Patch Level: 1.3.7
v1.3.7 [2008-01-09 08:14:36] (Fresh Installation)*

It was installed using GoDaddy's install tool (they install it for you). I have not done anything but install it, and than use a template for the layout. I can go in and edit any order not payed with via PayPal, however I get the above error on all PayPal orders. I just did a test order via PayPal and the order process works fine.

I appreciate the help. Let me know if you need any more info.

Thanks!

2 Feb 2008, 5:03 PM
#8
drbyte avatar

drbyte

Sensei

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

Re: 1054 Unknown column 'zen_order_id' in 'where clause'

Lead_Not_Follow:

I can go in and edit any order not payed with via PayPal, however I get the above error on all PayPal orders.

...

I just did a test order via PayPal and the order process works fine.

It doesn't make sense that you can place an order via PayPal without error, but cannot edit/view the order details via the admin ... unless you have installed a 1.3.8 PayPal module somewhere, or have altered the database in some way.

Anyway, you seem to believe that none of that has happened, so just go and manually fudge your database back to the old format and pray that everything else is fine. I DO NOT RECOMMEND THIS APPROACH, because I believe something else is wrong, but this is a bandage you can try at your own risk.

ALTER TABLE paypal CHANGE order_id  zen_order_id int(11) unsigned NOT NULL default '0';
```If that doesn't solve it, delete your database and your Zen Cart install, and start over from scratch.

You might consider installing v1.3.8 instead, since 1.3.7 is more than a year old.
2 Feb 2008, 5:20 PM
#9
lead_not_follow avatar

lead_not_follow

New Zenner

Join Date:
Jan 2008
Posts:
23
Plugin Contributions:
0

Re: 1054 Unknown column 'zen_order_id' in 'where clause'

Here is what it looks like when I go to that order. I'm assuming that it worked via PayPal since the order showed up and I received confirmation.

I did a test order and went as far as the PayPal screen without issues. If you want to try yourself you can by visiting the website HERE.

What is involved in doing an upgrade to v1.3.8? Will I loose all my info etc. or it something as simple as clicking a few buttons?

Thanks again for the help!

2 Feb 2008, 8:19 PM
#11
lead_not_follow avatar

lead_not_follow

New Zenner

Join Date:
Jan 2008
Posts:
23
Plugin Contributions:
0

Re: 1054 Unknown column 'zen_order_id' in 'where clause'

I think I'm going to just try to change the code first and see what happens (I'll of course do a backup first).

If I was to find the code needed to change as you mentioned, where would I go about looking?

I'm going to assume \includes\modules\payment\paypal but than where?

Doing the upgrade to v1.3.8 and saving everything looks like it's more than I think I can handle at the moment...

2 Feb 2008, 8:55 PM
#12
drbyte avatar

drbyte

Sensei

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

Re: 1054 Unknown column 'zen_order_id' in 'where clause'

The SQL statement I posted earlier is something you would run via phpMyAdmin or Admin->Tools->Install SQL Patch

2 Feb 2008, 9:03 PM
#13
lead_not_follow avatar

lead_not_follow

New Zenner

Join Date:
Jan 2008
Posts:
23
Plugin Contributions:
0

Re: 1054 Unknown column 'zen_order_id' in 'where clause'

DrByte:

The SQL statement I posted earlier is something you would run via phpMyAdmin or Admin->Tools->Install SQL Patch
I get this...

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 'paypal CHANGE order_id zen_order_id int(11) unsigned NOT NULL default '0'' at line 1
in:
[ALTER paypal CHANGE order_id zen_order_id int(11) unsigned NOT NULL default '0';]
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 apologize, I feel like I'm in over my head...

2 Feb 2008, 9:21 PM
#14
lead_not_follow avatar

lead_not_follow

New Zenner

Join Date:
Jan 2008
Posts:
23
Plugin Contributions:
0

Re: 1054 Unknown column 'zen_order_id' in 'where clause'

GRR I'm getting so frustrated with this! :frusty:

I'm about ready to just pay someone to upgrade to the new version and fix it for me! :blink:

2 Feb 2008, 9:54 PM
#15
drbyte avatar

drbyte

Sensei

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

Re: 1054 Unknown column 'zen_order_id' in 'where clause'

Oops ... try this:```
ALTER TABLE paypal CHANGE order_id zen_order_id int(11) unsigned NOT NULL default '0';

2 Feb 2008, 9:57 PM
#16
lead_not_follow avatar

lead_not_follow

New Zenner

Join Date:
Jan 2008
Posts:
23
Plugin Contributions:
0

Re: 1054 Unknown column 'zen_order_id' in 'where clause'

DrByte:

ALTER TABLE paypal CHANGE order_id zen_order_id int(11) unsigned NOT NULL default '0';

That did it!

Thanks a TON! I really really really appreciate it!

So I'm going to assume that since that fixed the problem that I *should* upgrade to v1.3.8 anyways?
15 Mar 2008, 1:20 PM
#17
cmyk avatar

cmyk

New Zenner

Join Date:
Dec 2007
Location:
Sydney Australia
Posts:
21
Plugin Contributions:
0

Re: 1054 Unknown column 'zen_order_id' in 'where clause'

Lead_Not_Follow:

I can go in and edit any order not payed with via PayPal, however I get the above error on all PayPal orders. I just did a test order via PayPal and the order process works fine.

I appreciate the help. Let me know if you need any more info.

Thanks!

Exact same problem I am having at the moment.
I installed 1.3.7 but updated to 1.3.8

15 Mar 2008, 1:41 PM
#18
cmyk avatar

cmyk

New Zenner

Join Date:
Dec 2007
Location:
Sydney Australia
Posts:
21
Plugin Contributions:
0

Re: 1054 Unknown column 'zen_order_id' in 'where clause'

Lead_Not_Follow:

That did it!

Thanks a TON! I really really really appreciate it!

So I'm going to assume that since that fixed the problem that I should upgrade to v1.3.8 anyways?

Holy ########!!!

That fixed it also ...
thankyou very much.

20 Apr 2008, 10:01 PM
#19
demotex avatar

demotex

New Zenner

Join Date:
Apr 2008
Posts:
8
Plugin Contributions:
0

Re: 1054 Unknown column 'zen_order_id' in 'where clause'

hi
i have the same problem with paypal and my mysql say this here after putting in the code:

#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 1

what can i do?

20 Apr 2008, 11:47 PM
#20
drbyte avatar

drbyte

Sensei

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

Re: 1054 Unknown column 'zen_order_id' in 'where clause'

demotex:

what can i do?

The best way to deal with the "unknown column 'zen_order_id'" message is to upgrade properly to v1.3.8.
EVERY other approach is playing with fire by having mixed versions of PHP vs database.