You are here:  » MySQL, adding a field

Support Forum



MySQL, adding a field

Submitted by apa on Tue, 2008-11-04 20:52 in

Hi,

I am trying to ad a new field in phpMyAdmin, but really have no experience with this (the first step in this tread... http://www.pricetapestry.com/node/313).

Do i ad it under "feeds", "product" or both? The other fields seems to be there.

Can you explain the process to me or maybe if possible supply a simple code to paste into the "Run SQL Query" form?

Kind regards,
Anders

Submitted by support on Wed, 2008-11-05 11:14

Hi Anders,

You need to add fields to both "feeds" and "products" tables. Let's say you want to add the field "tariff" as in the examples in the other thread. The "feeds" table must have the field "field_tariff" added, and the "products" table just a field called "tariff". You can do these with the following SQL statements:

ALTER TABLE `feeds` ADD `field_tariff` VARCHAR( 255 ) NOT NULL ;

ALTER TABLE `products` ADD `tariff` VARCHAR( 255 ) NOT NULL ;

(note that if you are using a database table prefix ($config_databaseTablePrefix) then you will need to include this value manually infront of the table names...)

Then just add the code modifications shown in the thread and you should be in business. I'm extremely familiar with these mods so if you find it doesn't work after making the changes email me your modified files and I'll check them over for you...

Cheers,
David.