Web Hosting Forum | Lunarpages
News: July 14, 2008 - New Contest! - Submit Your WordPress Theme Designs, Win BIG!
June 30, 2008 - Submit Your Site for the July 08 Site of the Month Award!
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
July 25, 2008, 05:41:33 PM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: OSCommerce 1054 - Unknown column 'orders_status_id'  (Read 1192 times)
smokejumpers
Space Explorer
***
Offline Offline

Posts: 6


« on: March 03, 2008, 03:49:08 PM »

Hi folks

Stats:
aquarius server
PHP 5.2.5
MySQL 5 (recently upgraded)
OSCommerce 2.2rc2

I have a store that has had several problems of late. We solved Echo not allowing a connection for unknown reasons by switching servers. In the process I reinstalled OSCommerce. Now it seems we are out of synch with the db somehow. When checking out I get the following:

Code:
1054 - Unknown column 'orders_status_id' in 'field list'

insert into orders_status_history (orders_id, orders_status_id, date_added, customer_notified, comments) values ('2141', '1', now(), '1', '')

[color=red][TEP STOP][/color]

Checking the db shows the columns for the table orders_status_history are:

Code:
orders_status_history_id, orders_id, new_value, old_value, date_added, customer_notified

In searching for an answer to this issue, I see that many are having problems with OSC after upgrading MySQL 5. I've even found a few posts here that talk about the 1054 error and left joins, but they all talk about a different column and table.

Any help is greatly appreciated.
Logged
MrPhil
Quantum Encyclopedia Writer
*****
Offline Offline

Posts: 3106



« Reply #1 on: March 03, 2008, 06:14:34 PM »

A new osC 2.2 RC2 installation defines the table as:

DROP TABLE IF EXISTS orders_status_history;
CREATE TABLE orders_status_history (
   orders_status_history_id int NOT NULL auto_increment,
   orders_id int NOT NULL,
   orders_status_id int(5) NOT NULL,
   date_added datetime NOT NULL,
   customer_notified int(1) DEFAULT '0',
   comments text,
   PRIMARY KEY (orders_status_history_id),
   KEY idx_orders_status_history_orders_id (orders_id)
);


Is this a fresh installation of RC2, or did you upgrade from an earlier version and miss a step in upgrading your database definitions?
Logged

smokejumpers
Space Explorer
***
Offline Offline

Posts: 6


« Reply #2 on: March 10, 2008, 09:47:08 AM »

Thanks very much for the timely reply. got sidetracked myself.

To answer the question, I installed fresh but with existing data. Just hooked right in. Not sure that I ran anything for the db, and that could indeed be my issue. Where abouts would I find the db upgrades in the oscommerce-2.2rc2a folder?

I actually did a bunch of stuff to different environments (setting up each to try things out) trying to solve a nasty but (turned out to be an Echo thing) and in the process have myself in a bit of a mess I guess because I don't recall exactly what I did in each. But the base install I believe is 2.2rc2 with old data.

I'm realizing that I must do some mysql upgrading. One of the problems I had was that I attempted to upgrade in one of the test installs I have running and had no end of misery. Is there an easy way to bring my table structure into line with existing data?

Many thanks!
/Jon
Logged
MrPhil
Quantum Encyclopedia Writer
*****
Offline Offline

Posts: 3106



« Reply #3 on: March 10, 2008, 03:42:24 PM »

So you've got a pre-RC2 database, and RC2 PHP code? They have made a number of changes to the database schema, so it's no surprise it doesn't work.

I don't see anything to automatically update your database (after just a quick look). You could certainly do it manually if you can't find something in the oscommerce-2.2rc2.zip file:

1) Back up your database.

2) Extract catalog/install/oscommerce.sql from the zip file, which will describe all the tables used. Browse it in an editor.

3) Go into phpMyAdmin and table-by-table look at each table's structure. Where there's a difference, you can modify fields (columns) and change data types and defaults, and add fields.

4) Add any new tables.

Warning: there are no guarantees that making changes won't break it even worse! Use your best judgment in filling in new values for changed or added fields.
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM