Thread: Need SQL help

Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2006
    Location
    Kihikihi, New Zealand
    Posts
    230
    Plugin Contributions
    3

    Default Need SQL help

    I am in the process of duplicating most of my store specially for wholesale.
    I have made a fresh zencart install and database (MySQL 5) and taken the product data from my existing store( MySQL 4.0). I changed some of the syntax to make it work. I now have products, and they do show in the html pages, but when I try to access them from the manager, I get the following error:

    1054 Unknown column 'p.products_upc' in 'field list'
    in:
    [select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_upc, p.products_isbn, p.products_image, p.products_price, p.products_virtual, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id, p.products_quantity_order_min, p.products_quantity_order_units, p.products_priced_by_attribute, p.product_is_free, p.product_is_call, p.products_quantity_mixed, p.product_is_always_free_shipping, p.products_qty_box_status, p.products_quantity_order_max, p.products_sort_order, p.products_discount_type, p.products_discount_type_from, p.products_price_sorter, p.master_categories_id from products p, products_description pd where p.products_id = '122' and p.products_id = pd.products_id and pd.language_id = '1']
    I tried to find this table in MySQL, and in a backup copy of the new database but the table does not appear to be there. This message keeps coming up for all my products.

    This is the table structure as taken from a backup copy:
    Code:
    CREATE TABLE `products` (
      `products_id` int(11) NOT NULL auto_increment,
      `products_type` int(11) NOT NULL default '1',
      `products_quantity` float NOT NULL default '0',
      `products_model` varchar(32) default NULL,
      `products_image` varchar(64) default NULL,
      `products_price` decimal(15,4) NOT NULL default '0.0000',
      `products_virtual` tinyint(1) NOT NULL default '0',
      `products_date_added` datetime NOT NULL default '0001-01-01 00:00:00',
      `products_last_modified` datetime default NULL,
      `products_date_available` datetime default NULL,
      `products_weight` float NOT NULL default '0',
      `products_status` tinyint(1) NOT NULL default '0',
      `products_tax_class_id` int(11) NOT NULL default '0',
      `manufacturers_id` int(11) default NULL,
      `products_ordered` float NOT NULL default '0',
      `products_quantity_order_min` float NOT NULL default '1',
      `products_quantity_order_units` float NOT NULL default '1',
      `products_priced_by_attribute` tinyint(1) NOT NULL default '0',
      `product_is_free` tinyint(1) NOT NULL default '0',
      `product_is_call` tinyint(1) NOT NULL default '0',
      `products_quantity_mixed` tinyint(1) NOT NULL default '0',
      `product_is_always_free_shipping` tinyint(1) NOT NULL default '0',
      `products_qty_box_status` tinyint(1) NOT NULL default '1',
      `products_quantity_order_max` float NOT NULL default '0',
      `products_sort_order` int(11) NOT NULL default '0',
      `products_discount_type` tinyint(1) NOT NULL default '0',
      `products_discount_type_from` tinyint(1) NOT NULL default '0',
      `products_price_sorter` decimal(15,4) NOT NULL default '0.0000',
      `master_categories_id` int(11) NOT NULL default '0',
      `products_mixed_discount_quantity` tinyint(1) NOT NULL default '1',
      `metatags_title_status` tinyint(1) NOT NULL default '0',
      `metatags_products_name_status` tinyint(1) NOT NULL default '0',
      `metatags_model_status` tinyint(1) NOT NULL default '0',
      `metatags_price_status` tinyint(1) NOT NULL default '0',
      `metatags_title_tagline_status` tinyint(1) NOT NULL default '0',
      PRIMARY KEY  (`products_id`),
      KEY `idx_products_date_added_zen` (`products_date_added`),
      KEY `idx_products_status_zen` (`products_status`),
      KEY `idx_products_date_available_zen` (`products_date_available`),
      KEY `idx_products_ordered_zen` (`products_ordered`),
      KEY `idx_products_model_zen` (`products_model`),
      KEY `idx_products_price_sorter_zen` (`products_price_sorter`),
      KEY `idx_master_categories_id_zen` (`master_categories_id`),
      KEY `idx_products_sort_order_zen` (`products_sort_order`),
      KEY `idx_manufacturers_id_zen` (`manufacturers_id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=534 DEFAULT CHARSET=utf8;
    What have I done wrong?

    Goshawk

  2. #2
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Need SQL help

    Quote Originally Posted by Goshawk View Post
    I have made a fresh zencart install and database (MySQL 5) and taken the product data from my existing store( MySQL 4.0). I changed some of the syntax to make it work. I now have products, and they do show in the html pages, but when I try to access them from the manager, I get the following error:

    1054 Unknown column 'p.products_upc' in 'field list'
    I tried to find this table in MySQL, and in a backup copy of the new database but the table does not appear to be there. This message keeps coming up for all my products.
    That's because ... the field doesn't exist ... exactly as the error message says.

    You have a PHP script that's looking for a products_upc field in your database ... but you're running it against a database that doesn't have that field. Hence the error.


    Your products_upc reference is likely from one of numinix's mods that has traces left in your PHP files.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Aug 2006
    Location
    Kihikihi, New Zealand
    Posts
    230
    Plugin Contributions
    3

    Default Re: Need SQL help

    Thanks

    Thanks will probably be Quick updates I will replace the php file with the original zencart one, hopefully it will overcome this

    Goshawk

 

 

Similar Threads

  1. Need help creating SQL query...
    By DigitalShadow in forum General Questions
    Replies: 2
    Last Post: 22 Jun 2011, 02:05 PM
  2. Need SQL help
    By eaglewu in forum General Questions
    Replies: 1
    Last Post: 21 Aug 2010, 01:35 AM
  3. PHP or SQL Issue - Need help please
    By netwiser in forum Installing on a Linux/Unix Server
    Replies: 1
    Last Post: 17 Feb 2010, 11:19 PM
  4. Need help w/ SQL query in phpMyAdmin
    By audradh in forum General Questions
    Replies: 17
    Last Post: 16 Nov 2009, 01:05 PM
  5. Need Help with SQL error
    By kevinmc3 in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 4 Apr 2008, 07:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg