Post by nde » Sun Feb 15, 2009 9:29 am

This error occurs when I try to place an order, after I've chosen the payment method (?route=checkout/confirm):

Code: Select all

Error: Unknown column 'product_id' in 'field list'
Error No: 1054
INSERT INTO order_product SET order_id = '10', product_id = '43', name = 'MacBook', model = 'Product 16', price = '500', discount = '0', total = '500', tax = '0', quantity = '1'

nde
New member

Posts

Joined
Sat Jun 30, 2007 7:32 am

Post by Daniel » Sun Feb 15, 2009 9:41 am

add this in you SQl manager:

ALTER TABLE `order_product` ADD `product_id` INT( 11 ) NOT NULL AFTER `order_id`;


http://forum.opencart.com/index.php/topic,3056.0.html

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by nde » Sun Feb 15, 2009 10:09 am

Thanks for the quick help. I just ran the query but the error still occurs.
It's a fresh 1.1.7 install.

nde
New member

Posts

Joined
Sat Jun 30, 2007 7:32 am

Post by Daniel » Sun Feb 15, 2009 10:14 am

open phpmyadmin and check if the field is there manually.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by ksjones » Mon Feb 16, 2009 8:50 am

Adding the field worked fine, will you be creating a new package of the installer for this?

Quick suggestion for future development and bug fixes to the DB, could you add a SQL extension where the DB can have SQL commands executed to it? That way you can supply upgrade scripts that alter the DB structure and users would only need to upload new files.

Cheers K

Newbie

Posts

Joined
Sat Feb 14, 2009 9:32 pm

Post by Daniel » Mon Feb 16, 2009 9:39 am

ksjones wrote: Adding the field worked fine, will you be creating a new package of the installer for this?

Quick suggestion for future development and bug fixes to the DB, could you add a SQL extension where the DB can have SQL commands executed to it? That way you can supply upgrade scripts that alter the DB structure and users would only need to upload new files.

Cheers K
no because it makes the whole system insecure!

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by nde » Mon Feb 16, 2009 10:08 am

Daniel wrote: open phpmyadmin and check if the field is there manually.
Sorry, I had the wrong database, it works. Your fix helped.

nde
New member

Posts

Joined
Sat Jun 30, 2007 7:32 am

Post by donb » Tue Feb 17, 2009 7:50 am

I have done everything here and still get the error.  Here is a screen shot of my order_product table.

http://img.skitch.com/20090216-cphq2a5f ... review.jpg[/img]
Click for full size - Uploaded with plasq's Skitch

I apologize in advance for not being an mySQL wizard. 

Here is the error I am receiving.

Code: Select all

Error: Unknown column 'product_id' in 'field list'
Error No: 1054
INSERT INTO order_product SET order_id = '4', product_id = '49', name = 'Fireball Tim's "HOLLYWOOD MOVIE CAR" Design Book ', model = 'fbb001', price = '2.5', discount = '0', total = '2.5', tax = '0', quantity = '1'

Newbie

Posts

Joined
Tue Feb 17, 2009 12:08 am

Post by fido-x » Tue Feb 17, 2009 7:58 am

You need to run this as an SQL query against your database --

Code: Select all

ALTER TABLE `order_product` ADD `product_id` INT( 11 ) NOT NULL default '0' AFTER `order_id`;
to put the "product_id" field in the table.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by donb » Fri Feb 20, 2009 12:48 am

That did the trick and I'm able to take payment. I had to manually enter the field into the table however. Thanks!

Newbie

Posts

Joined
Tue Feb 17, 2009 12:08 am
Who is online

Users browsing this forum: No registered users and 9 guests