sheltonjb Posted March 16, 2007 Posted March 16, 2007 Hi guys, I have no knowledge of databases at all and have just installed the discount coupon contribution. This will probably be a really easy problem for someone to solve, but as i know little about php and nothing about sql i need someone to talk me through it step by step in lehmans terms, anyways, here goes... the install file within the discount coupon zip file said this: **************** STEP 2 ****************Create the database tables Run these statements via the SQL tab in phpMyAdmin. CREATE TABLE discount_coupons ( coupons_id VARCHAR(32) NOT NULL DEFAULT '', coupons_description VARCHAR(64) NOT NULL DEFAULT '', coupons_discount_percent DECIMAL(7,4) DEFAULT NULL, coupons_date_start DATETIME DEFAULT NULL, coupons_date_end DATETIME DEFAULT NULL, coupons_max_use INT(3) NOT NULL DEFAULT 0, coupons_min_order DECIMAL(15,4) NOT NULL DEFAULT '0.0000', coupons_max_order DECIMAL(15,4) NOT NULL DEFAULT '0.0000', coupons_number_available INT(3) DEFAULT 0 NOT NULL, PRIMARY KEY (coupons_id) ); CREATE TABLE discount_coupons_to_orders ( discount_coupons_to_orders_id INT(11) NOT NULL AUTO_INCREMENT, coupons_id VARCHAR(32) DEFAULT NULL, orders_id INT(11) DEFAULT '0', PRIMARY KEY (discount_coupons_to_orders_id), KEY coupons_id (coupons_id) ); So, after doing a search i saw a post saying 'post that query into your sql tab in phpmyadmin' so i did. and now when i go to my 'order total > discount coupons' within the admin section of osCommerce i am left with the following error: 1146 - Table 'shel0710_osc1.TABLE_DISCOUNT_COUPONS' doesn't exist select count(*) as total from TABLE_DISCOUNT_COUPONS cd [TEP STOP] So i went back to the sql and tried to paste the query again (as stated in the install file - above) but now it says this: ErrorSQL query: CREATE TABLE discount_coupons( coupons_id VARCHAR( 32 ) NOT NULL DEFAULT '', coupons_description VARCHAR( 64 ) NOT NULL DEFAULT '', coupons_discount_percent DECIMAL( 7, 4 ) DEFAULT NULL , coupons_date_start DATETIME DEFAULT NULL , coupons_date_end DATETIME DEFAULT NULL , coupons_max_use INT( 3 ) NOT NULL DEFAULT 0, coupons_min_order DECIMAL( 15, 4 ) NOT NULL DEFAULT '0.0000', coupons_max_order DECIMAL( 15, 4 ) NOT NULL DEFAULT '0.0000', coupons_number_available INT( 3 ) DEFAULT 0 NOT NULL , PRIMARY KEY ( coupons_id ) ); MySQL said: #1050 - Table 'discount_coupons' already exists Can someone please help on what i've done wrong and how i can fix it? should i have posted the query's seperate? because looking back i think they were suppose to be seperate? is that right? Do i have to delete the query? how do i do that? much appreciated. thanks alot Shelton Brown Web/Graphic Designer
Bushmaster Posted March 17, 2007 Posted March 17, 2007 When your in phpMyAdmin on the first page to come up click the name of your data base. I will list all the tables you have. Place a check mark in front of the ones you added. Just below the list of tables there should be a box that says with selected. Chose drop from the list and it will remove them. Once those have been removed go back to the same list of table and at the bottom click select all and then chose Optimize table. Then try to add the ones you need again. Try each table create on its own. Then Optomize again before you leave.
Bushmaster Posted March 17, 2007 Posted March 17, 2007 I just seen your other post on your data bases get them strat first before you do any thing. That may fix your problem.If you installed the tables to osc1 and it is looking at osc5 then it will say they are not there.
sheltonjb Posted March 17, 2007 Author Posted March 17, 2007 When your in phpMyAdmin on the first page to come up click the name of your data base. I will list all the tables you have. Place a check mark in front of the ones you added. Just below the list of tables there should be a box that says with selected. Chose drop from the list and it will remove them. Once those have been removed go back to the same list of table and at the bottom click select all and then chose Optimize table. Then try to add the ones you need again. Try each table create on its own. Then Optomize again before you leave. hi bud, i've done as you stated but when i try and re-submitted those query instructions i get this: Warning: Cannot modify header information - headers already sent by (output started at /usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries/header_meta_style.inc.php:27) in /usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries/common.lib.php on line 1154 Shelton Brown Web/Graphic Designer
djmonkey1 Posted March 17, 2007 Posted March 17, 2007 You need to follow the install instructions that came with the contribution. admin/includes/database_tables.php -------------------------------------------- add //kgt - discount coupons define('TABLE_DISCOUNT_COUPONS', 'discount_coupons'); define('TABLE_DISCOUNT_COUPONS_TO_ORDERS', 'discount_coupons_to_orders'); //end kgt - discount coupons Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.