Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How do I add 'p.products_bimage' in 'field list'?


Aye Poppin

Recommended Posts

I have an error 1054- Unknown column 'p.products_bimage' in 'field list' after adding Big Images and have no idea what to do . Please help?

 

the installation instructions for big images should have come with the instructions. you need to add the products_bimage column to the products table. use phpmyadmin to run the alter table statement that the installation instructions gave you.

Link to comment
Share on other sites

Ok where do I put the code? Say to do this.

 

ALTER TABLE `products` ADD `products_bimage` VARCHAR(64) AFTER `products_image`;

 

 

 

 define('TABLE_ORDERS_TOTAL', 'orders_total');
 define('TABLE_PRODUCTS', 'products');
 define('TABLE_PRODUCTS_ATTRIBUTES', 'products_attributes');
 define('TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD', 'products_attributes_download');
 define('TABLE_PRODUCTS_DESCRIPTION', 'products_description');
 define('TABLE_PRODUCTS_NOTIFICATIONS', 'products_notifications');
 define('TABLE_PRODUCTS_OPTIONS', 'products_options');
 define('TABLE_PRODUCTS_OPTIONS_VALUES', 'products_options_values');
 define('TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS', 'products_options_values_to_products_options');
 define('TABLE_PRODUCTS_TO_CATEGORIES', 'products_to_categories');
 define('TABLE_REVIEWS', 'reviews');

Link to comment
Share on other sites

You should have access to a MySQL GUI through your host's control panel, for the purpose of altering the database. That GUI is usually phpMyAdmin but not always. Once you access it, select your database, click on the SQL tab, enter that query and click Go.

Link to comment
Share on other sites

Well, you could ask them to do it for you or better still, get them to make phpMyAdmin work for you. Failing that, you could do it direct from a backup.

 

Create a backup in Admin, download it, rename it so it can be uploaded without overwriting the one on the server, open it in a text editor and add the new field.

 

i.e. Make this section of the backup:

 

drop table if exists products;
create table products (
 products_id int(11) not null auto_increment,
 products_quantity int(4) not null ,
 products_model varchar(12) ,
 products_image varchar(64) ,
 products_price decimal(15,4) not null ,
 products_date_added datetime not null ,
 products_last_modified datetime ,
 products_date_available datetime ,
 products_weight decimal(5,2) not null ,
 products_status tinyint(1) not null ,
 products_tax_class_id int(11) not null ,
 manufacturers_id int(11) ,
 products_ordered int(11) default '0' not null ,
 PRIMARY KEY (products_id),
 KEY idx_products_date_added (products_date_added)
);

 

 

Look like this:

 

drop table if exists products;
create table products (
 products_id int(11) not null auto_increment,
 products_quantity int(4) not null ,
 products_model varchar(12) ,
 products_image varchar(64) ,
 products_bimage varchar(64) ,
 products_price decimal(15,4) not null ,
 products_date_added datetime not null ,
 products_last_modified datetime ,
 products_date_available datetime ,
 products_weight decimal(5,2) not null ,
 products_status tinyint(1) not null ,
 products_tax_class_id int(11) not null ,
 manufacturers_id int(11) ,
 products_ordered int(11) default '0' not null ,
 PRIMARY KEY (products_id),
 KEY idx_products_date_added (products_date_added)
);

 

 

Once edited and renamed, upload it again to the admin/backups directory, then restore it from your admin. The only thing you are changing in the backup is the addition of the extra field in the products table. You don't need to alter or delete anything from that backup.

 

If you aren't comfortable editing in this way - don't do it! If you mess up, your store will go down. Which is why it is important to keep the unedited backup also.

Link to comment
Share on other sites

I can't find that file. nothing called product tables.

 

There isn't a file called products table, the products table is in the database. Have you never made a database backup?

 

I think maybe you should ask your host to run the query on the database for you.

 

ALTER TABLE `products` ADD `products_bimage` VARCHAR(64) AFTER `products_image`;

 

They will do it in seconds but you need to ask them why you can't access phpMyAdmin.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...