Jump to content
Sign in to follow this  
Graphicpoet

file feature 77 (Uploading Images to site)

Recommended Posts

I have pretty much done everything short of putting up the altered pages from the installation folder.

 

I am just now becoming aquainted with database technology so I would appriciate any help as to why I get an error trying to install the .....---option_type_feature.sql----

 

When I install the below content I get the error---------------------------------------------------------------

 

Error

 

SQL-query :

 

ALTER TABLE products_options ADD products_options_type INT( 5 ) NOT NULL ,

ADD products_options_length SMALLINT( 2 ) DEFAULT '32' NOT NULL ,

ADD products_options_comment VARCHAR( 32 )

 

MySQL said:

 

#1060 - Duplicate column name 'products_options_type'

 

[Documentation] ? [back]--------------------------------------------------------------------------------------

 

 

Here is the install:::::

 

ALTER TABLE products_options

ADD products_options_type INT( 5 ) NOT NULL ,

ADD products_options_length SMALLINT( 2 ) DEFAULT '32' NOT NULL ,

ADD products_options_comment VARCHAR( 32 ) ;

 

ALTER TABLE customers_basket_attributes

ADD products_options_value_text VARCHAR( 32 ) ;

 

INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES (169, 'Product option type Select', 'PRODUCTS_OPTIONS_TYPE_SELECT', '0', 'The number representing the Select type of product option.', 0, NULL, now(), now(), NULL, NULL);

INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES (170, 'Text product option type', 'PRODUCTS_OPTIONS_TYPE_TEXT', '1', 'Numeric value of the text product option type', 6, NULL, now(), now(), NULL, NULL);

INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES (171, 'Radio button product option type', 'PRODUCTS_OPTIONS_TYPE_RADIO', '2', 'Numeric value of the radio button product option type', 6, NULL, now(), now(), NULL, NULL);

INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES (172, 'Check box product option type', 'PRODUCTS_OPTIONS_TYPE_CHECKBOX', '3', 'Numeric value of the check box product option type', 6, NULL, now(), now(), NULL, NULL);

INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES (173, 'File product option type', 'PRODUCTS_OPTIONS_TYPE_FILE', '4', 'Numeric value of the file product option type', 6, NULL, now(), now(), NULL, NULL);

INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES (174, 'ID for text and file oroducts options values', 'PRODUCTS_OPTIONS_VALUE_TEXT_ID', '0', 'Numeric value of the products_options_values_id used by the text and file attributes.', 6, NULL, now(), now(), NULL, NULL);

INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES (175, 'Upload prefix', 'UPLOAD_PREFIX', 'upload_', 'Prefix used to differentiate between upload options and other options', 0, NULL, now(), now(), NULL, NULL);

INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES (176, 'Text prefix', 'TEXT_PREFIX', 'txt_', 'Prefix used to differentiate between text option values and other option values', 0, NULL, now(), now(), NULL, NULL);

 

CREATE TABLE `products_options_types` (

`products_options_types_id` int(11) NOT NULL default '0',

`products_options_types_name` varchar(32) default NULL,

`language_id` int(11) NOT NULL default '0',

PRIMARY KEY (`products_options_types_id`,`language_id`)

) TYPE=MyISAM COMMENT='Track products_options_types';

 

INSERT INTO `products_options_types` (`products_options_types_id`, `products_options_types_name`, `language_id`) VALUES (0, 'Select', 1);

INSERT INTO `products_options_types` (`products_options_types_id`, `products_options_types_name`, `language_id`) VALUES (1, 'Text', 1);

INSERT INTO `products_options_types` (`products_options_types_id`, `products_options_types_name`, `language_id`) VALUES (2, 'Radio', 1);

INSERT INTO `products_options_types` (`products_options_types_id`, `products_options_types_name`, `language_id`) VALUES (3, 'Checkbox', 1);

INSERT INTO `products_options_types` (`products_options_types_id`, `products_options_types_name`, `language_id`) VALUES (4, 'File', 1);

 

 

 

 

Thanks Graphicpoet

Share this post


Link to post
Share on other sites

MySQL said:

 

#1060 - Duplicate column name 'products_options_type'

 

means the column is already in the database, thus you will either have to remove that insert or delete the field in the table so you can run the insert. however if deleting you may wipe out existing data.


John Oligario

 

Knowledge Base Contributions

Share this post


Link to post
Share on other sites
MySQL said:

 

#1060 - Duplicate column name 'products_options_type'

 

means the column is already in the database, thus you will either have to remove that insert or delete the field in the table so you can run the insert.  however if deleting you may wipe out existing data.

 

 

Thanks so much for your reply. I was told:

 

It just reports that the column already exists, so you probably already executed the query.

Since these queries do not return results, it's not that obvious if it ran successfully.

 

--To check if it finished the last step, run the sql query;

select * from products_options_types

 

I did that and got:

 

Error

 

SQL-query :

 

SELECT *

FROM products_options_types

LIMIT 0 , 50

 

MySQL said:

 

#1146 - Table 'XXXXXX.products_options_types' doesn't exist

 

[Documentation] ? [back]

 

NOW as far as DATA is concerned other than the esthetics of the design there is NO data needed to be saved. From the data perspective this is a "NEW INSTALL." I just do not want it to effect any of the 3 or 4 other contributions already installed on this store site.

 

 

Now I looked for the column to see if it was present, but got this back:

 

end.database.gif

 

 

The reason I am being so detailed here is this is the VERY LAST THING I HAVE TO DO to make this contribution operational. I have spent hours merging .php files and rechecking and confirming those merges. I get to this one database install and get stuck. My lack of knowledge of course but still disheartening..... I could pay someone, but I really need to do this.

 

 

here is a link to the data I am trying to put in------The Database content

 

Is there anything I can do here in this area below to put this into the database?:

 

 

can.gif

Share this post


Link to post
Share on other sites

I have encountered a fatal error since installing the upload contribution. The admin side seems to be going great just need to get the sight back showing...

 

Fatal error: Cannot redeclare class tablebox in /www/M/Mysight/root/Mystore/includes/classes/boxes.php on line 13

 

 

 

Thanks in advance...

Share this post


Link to post
Share on other sites
I have encountered a fatal error since installing the upload contribution. The admin side seems to be going great just need to  get the sight back showing...

 

Fatal error: Cannot redeclare class tablebox in /www/M/Mysight/root/Mystore/includes/classes/boxes.php on line 13

Thanks in advance...

 

I am getting the exact same error

i also have file upload .7 installed

and just installed the Option price break per barrior which is not working

and it gives me this error repeatedly

did u figure out how to work

here is the code for my boxes.php :

<?php
/*
 $Id: boxes.php,v 1.33 2003/06/09 22:22:50 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 class tableBox {
   var $table_border = '0';
   var $table_width = '100%';
   var $table_cellspacing = '0';
   var $table_cellpadding = '2';
   var $table_parameters = '';
   var $table_row_parameters = '';
   var $table_data_parameters = '';

// class constructor
   function tableBox($contents, $direct_output = false) {
     $tableBox_string = '<table border="' . tep_output_string($this->table_border) . '" width="' . tep_output_string($this->table_width) . '" cellspacing="' . tep_output_string($this->table_cellspacing) . '" cellpadding="' . tep_output_string($this->table_cellpadding) . '"';
     if (tep_not_null($this->table_parameters)) $tableBox_string .= ' ' . $this->table_parameters;
     $tableBox_string .= '>' . "\n";

     for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
       if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= $contents[$i]['form'] . "\n";
       $tableBox_string .= '  <tr';
       if (tep_not_null($this->table_row_parameters)) $tableBox_string .= ' ' . $this->table_row_parameters;
       if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox_string .= ' ' . $contents[$i]['params'];
       $tableBox_string .= '>' . "\n";

       if (isset($contents[$i][0]) && is_array($contents[$i][0])) {
         for ($x=0, $n2=sizeof($contents[$i]); $x<$n2; $x++) {
           if (isset($contents[$i][$x]['text']) && tep_not_null($contents[$i][$x]['text'])) {
             $tableBox_string .= '    <td';
             if (isset($contents[$i][$x]['align']) && tep_not_null($contents[$i][$x]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i][$x]['align']) . '"';
             if (isset($contents[$i][$x]['params']) && tep_not_null($contents[$i][$x]['params'])) {
               $tableBox_string .= ' ' . $contents[$i][$x]['params'];
             } elseif (tep_not_null($this->table_data_parameters)) {
               $tableBox_string .= ' ' . $this->table_data_parameters;
             }
             $tableBox_string .= '>';
             if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= $contents[$i][$x]['form'];
             $tableBox_string .= $contents[$i][$x]['text'];
             if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= '</form>';
             $tableBox_string .= '</td>' . "\n";
           }
         }
       } else {
         $tableBox_string .= '    <td';
         if (isset($contents[$i]['align']) && tep_not_null($contents[$i]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i]['align']) . '"';
         if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) {
           $tableBox_string .= ' ' . $contents[$i]['params'];
         } elseif (tep_not_null($this->table_data_parameters)) {
           $tableBox_string .= ' ' . $this->table_data_parameters;
         }
         $tableBox_string .= '>' . $contents[$i]['text'] . '</td>' . "\n";
       }

       $tableBox_string .= '  </tr>' . "\n";
       if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= '</form>' . "\n";
     }

     $tableBox_string .= '</table>' . "\n";

     if ($direct_output == true) echo $tableBox_string;

     return $tableBox_string;
   }
 }

 class infoBox extends tableBox {
   function infoBox($contents) {
     $info_box_contents = array();
     $info_box_contents[] = array('text' => $this->infoBoxContents($contents));
     $this->table_cellpadding = '1';
     $this->table_parameters = 'class="infoBox"';
     $this->tableBox($info_box_contents, true);
   }

   function infoBoxContents($contents) {
     $this->table_cellpadding = '3';
     $this->table_parameters = 'class="infoBoxContents"';
     $info_box_contents = array();
     $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
     for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
       $info_box_contents[] = array(array('align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''),
                                          'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''),
                                          'params' => 'class="boxText"',
                                          'text' => (isset($contents[$i]['text']) ? $contents[$i]['text'] : '')));
     }
     $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
     return $this->tableBox($info_box_contents);
   }
 }

 class infoBoxHeading extends tableBox {
   function infoBoxHeading($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
     $this->table_cellpadding = '0';

     if ($left_corner == true) {
       $left_corner = tep_image(DIR_WS_IMAGES . 'infobox/corner_left.gif');
     } else {
       $left_corner = tep_image(DIR_WS_IMAGES . 'infobox/corner_right_left.gif');
     }
     if ($right_arrow == true) {
       $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_IMAGES . 'infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
     } else {
       $right_arrow = '';
     }
     if ($right_corner == true) {
       $right_corner = $right_arrow . tep_image(DIR_WS_IMAGES . 'infobox/corner_right.gif');
     } else {
       $right_corner = $right_arrow . tep_draw_separator('pixel_trans.gif', '11', '14');
     }

     $info_box_contents = array();
     $info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"',
                                        'text' => $left_corner),
                                  array('params' => 'width="100%" height="14" class="infoBoxHeading"',
                                        'text' => $contents[0]['text']),
                                  array('params' => 'height="14" class="infoBoxHeading" nowrap',
                                        'text' => $right_corner));

     $this->tableBox($info_box_contents, true);
   }
 }

 class contentBox extends tableBox {
   function contentBox($contents) {
     $info_box_contents = array();
     $info_box_contents[] = array('text' => $this->contentBoxContents($contents));
     $this->table_cellpadding = '1';
     $this->table_parameters = 'class="infoBox"';
     $this->tableBox($info_box_contents, true);
   }

   function contentBoxContents($contents) {
     $this->table_cellpadding = '4';
     $this->table_parameters = 'class="infoBoxContents"';
     return $this->tableBox($contents);
   }
 }

 class contentBoxHeading extends tableBox {
   function contentBoxHeading($contents) {
     $this->table_width = '100%';
     $this->table_cellpadding = '0';

     $info_box_contents = array();
     $info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"',
                                        'text' => tep_image(DIR_WS_IMAGES . 'infobox/corner_left.gif')),
                                  array('params' => 'height="14" class="infoBoxHeading" width="100%"',
                                        'text' => $contents[0]['text']),
                                  array('params' => 'height="14" class="infoBoxHeading"',
                                        'text' => tep_image(DIR_WS_IMAGES . 'infobox/corner_right_left.gif')));

     $this->tableBox($info_box_contents, true);
   }
 }

 class errorBox extends tableBox {
   function errorBox($contents) {
     $this->table_data_parameters = 'class="errorBox"';
     $this->tableBox($contents, true);
   }
 }

 class productListingBox extends tableBox {
   function productListingBox($contents) {
     $this->table_parameters = 'class="productListing"';
     $this->tableBox($contents, true);
   }
 }
?>

 

Please if any1 knows how to fix this

do reply thanks in advance

 

mark

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×