PerryF Posted September 24, 2010 Posted September 24, 2010 When you go to our oscommerce site (www.beethovenpianos.com/accessories) and try to order an item a message appears below the item - 1146 error and some more text. I searched on the internet and found references to this being an installation error. I have not added any contributions and I am using the Theme provided by Siteground. Can you help correct this problem? Thanks Here is the complete error message: 1146 - Table 'beethove_osc1.orders' doesn't exist select p.products_id, p.products_image from orders_products opa, orders_products opb, orders o, products p where opa.products_id = '206' and opa.orders_id = opb.orders_id and opb.products_id != '206' and opb.products_id = p.products_id and opb.orders_id = o.orders_id and p.products_status = '1' group by p.products_id order by o.date_purchased desc limit 6 My host informs me to do a complete backup or that they could. But then informed me it was too late to perform the specific backup and that I should check available backups homes 2010-09-18 08:19:12.159456 mailweekly 2010-09-21 01:26:52.654839 sqldaily 23-09-10 04:32h sqlweekly 19-09-10 03:51h I have not idea where these are located or what they have to do with fixing Error 1146. Could someone please HELP me with step by step instructions. I am new to oscommerce but learning every day.
MrPhil Posted September 24, 2010 Posted September 24, 2010 Was the store working properly before, or is the first time? Do other parts work OK without error? The error message is telling you that the orders table was never created during installation. Go into phpMyAdmin and check how many "tables" are listed. There should be at least 47 tables there. If only "orders" is missing for some reason, create it: CREATE TABLE orders ( orders_id int NOT NULL auto_increment, customers_id int NOT NULL, customers_name varchar(64) NOT NULL, customers_company varchar(32), customers_street_address varchar(64) NOT NULL, customers_suburb varchar(32), customers_city varchar(32) NOT NULL, customers_postcode varchar(10) NOT NULL, customers_state varchar(32), customers_country varchar(32) NOT NULL, customers_telephone varchar(32) NOT NULL, customers_email_address varchar(96) NOT NULL, customers_address_format_id int(5) NOT NULL, delivery_name varchar(64) NOT NULL, delivery_company varchar(32), delivery_street_address varchar(64) NOT NULL, delivery_suburb varchar(32), delivery_city varchar(32) NOT NULL, delivery_postcode varchar(10) NOT NULL, delivery_state varchar(32), delivery_country varchar(32) NOT NULL, delivery_address_format_id int(5) NOT NULL, billing_name varchar(64) NOT NULL, billing_company varchar(32), billing_street_address varchar(64) NOT NULL, billing_suburb varchar(32), billing_city varchar(32) NOT NULL, billing_postcode varchar(10) NOT NULL, billing_state varchar(32), billing_country varchar(32) NOT NULL, billing_address_format_id int(5) NOT NULL, payment_method varchar(255) NOT NULL, cc_type varchar(20), cc_owner varchar(64), cc_number varchar(32), cc_expires varchar(4), last_modified datetime, date_purchased datetime, orders_status int(5) NOT NULL, orders_date_finished datetime, currency char(3), currency_value decimal(14,6), PRIMARY KEY (orders_id), KEY idx_orders_customers_id (customers_id) ); You could cut and paste the above code into the phpMyAdmin SQL tab, or use the information to manually create the table, entering one new field definition at a time. If more than "orders" is missing, you probably have a seriously botched installation and should consider starting over. If this site has been running for a while and you had data in the "orders" table, you would want to find the latest backup that includes that table and its data. It would hopefully be in one of the sql* backups -- you'll have to work with your host as to how to look inside the various backups and extract just the orders table. Hopefully it is .sql format, which is just a plain text file, which you can edit with an ordinary text editor (e.g., Notepad). You would snip out the DROP TABLE (if given), CREATE TABLE (if given), and INSERT INTO commands pertaining to orders. Put them into a restore.sql file and use phpMyAdmin "import" to upload and run this file. That's the usual method -- make sure that any existing copy of that table is dropped (deleted) before trying to create a new one, and make sure you have an empty copy of the table before loading it with data. Your particular host may have different ways of doing these things, so you'll have to work with them to see what's what. If your host managed to lose an entire table out of a production system, that doesn't reflect very well on them (assuming you haven't been hacked and someone deliberately wiped out a table). Anyway, that's why backups exist. If orders is the only missing or damaged table, just make sure you restore only it, rather than restoring your entire database.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.