Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Configuring the Zen Cart Admin / 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

Started by mtrantas on 31 Jan 2008, 6:26 PM · Views: 7,799

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

Post #1 by mtrantas

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

Post #2 by mtrantas

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

Post #3 by lead_not_follow

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,512
Plugin Contributions:
176

Post #4 by 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.

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

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

Post #5 by lead_not_follow

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,512
Plugin Contributions:
176

Post #6 by 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?

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

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

Post #7 by lead_not_follow

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,512
Plugin Contributions:
176

Post #8 by drbyte

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.

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

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

Post #9 by lead_not_follow

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, 5:58 PM
#10
drbyte avatar

drbyte

Sensei

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

Post #10 by drbyte

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

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

Post #11 by lead_not_follow

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,512
Plugin Contributions:
176

Post #12 by drbyte

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

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

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

Post #13 by lead_not_follow

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

Post #14 by lead_not_follow

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,512
Plugin Contributions:
176

Post #15 by drbyte

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

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

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

Post #16 by lead_not_follow

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

Post #17 by cmyk

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

Post #18 by cmyk

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

Post #19 by demotex

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,512
Plugin Contributions:
176

Post #20 by drbyte

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.

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