Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    Oct 2011
    Posts
    15
    Plugin Contributions
    0

    Default Adding New Products makes NULL Product_id

    Hello All,
    I have google searched this and can not find any answers.

    Something has happened where, when I try to add a new product, after I click on Preview, then Insert...
    The product doesn't appear in the list (category of where I added it).
    So then I check using PHPMYADMIN to see what is going on and I
    have 165 products listed, the 166th one has Products_Id is NULL (ie. It says NULL) instead of 166
    All the product info is there, but the Products_Id is NULL... obviously it won't show anywhere on the site.

    I have checked the other 2 tables that have to be the same and they have 0 (zero) in the Products_Id field.

    When I try to add another product, it now comes up automatically with this Corrupt product details and if I add it again, it puts another load of details in the Fields with a NULL Products_Id again.
    Please help.


    Using the latest version

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Adding New Products makes NULL Product_id

    Sounds like you've lost the auto_increment setting in the database for the products_id field on your products table. That sort of thing generally only happens when doing an export/import of the database when changing servers and changing MySQL versions at the same time, or when someone is tampering with the database structure without sufficient understanding of the impact of messing around.
    .

    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
    Oct 2011
    Posts
    15
    Plugin Contributions
    0

    Default Re: Adding New Products makes NULL Product_id

    Hello,

    Thankyou very much for this... Yes I actually just figured it out and came back here to post the answer. You are absolutely correct, the auto-increment got buggered up for some reason.
    I made it a primary key and set it to auto-increment and all good now.
    Thankyou.

 

 

Similar Threads

  1. Replies: 7
    Last Post: 4 May 2016, 01:59 AM
  2. Replies: 11
    Last Post: 15 Jan 2010, 04:44 PM
  3. Using HTML Code in The add new Products section just makes a mess on me?
    By austrainer in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 3 Jan 2008, 06:05 PM
  4. new products are always coming up product_id = 0
    By jeffmic in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 20 Dec 2006, 05:39 PM
  5. Replies: 7
    Last Post: 24 Jun 2006, 06:06 PM

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