Posting to SQL table problem?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TimmyC
    New Member
    • Feb 2007
    • 3

    #1

    Posting to SQL table problem?

    I recently had a program written in php for e-commerce, but there seems to be a problem with the posting of the cart id to the SQL table. The designer is no longer available for questions, so I had hoped to get some help here. I have a brief knowledge of php, but just cant seem to track the problem down.

    There are two tables used for the cart:

    store_shopping_ cart and
    store_shopping_ cart_items

    Everything works fine until you try to add an item to the cart. It tries to enter a null value into store_shopping_ cart_items for the column shopping_cart_i d

    The shopping cart id obviously cannot be null or there could be major confusion between different customers.

    I know you need more information and to look at the code to give me an answer, but there are many dependent php files (classes.php,co mmon.php, etc.) I didnt want to post them all here and waste a bunch of space..

    Could some1 contact me and help me track this problem down? I'd like to get the site up and working asap because its a much better design than our current site.

    Thanks
    TimmyC
    TimmyC@5thavenu ebling.com
  • Motoma
    Recognized Expert Specialist
    • Jan 2007
    • 3236

    #2
    Originally posted by TimmyC
    I recently had a program written in php for e-commerce, but there seems to be a problem with the posting of the cart id to the SQL table. The designer is no longer available for questions, so I had hoped to get some help here. I have a brief knowledge of php, but just cant seem to track the problem down.

    There are two tables used for the cart:

    store_shopping_ cart and
    store_shopping_ cart_items

    Everything works fine until you try to add an item to the cart. It tries to enter a null value into store_shopping_ cart_items for the column shopping_cart_i d

    The shopping cart id obviously cannot be null or there could be major confusion between different customers.

    I know you need more information and to look at the code to give me an answer, but there are many dependent php files (classes.php,co mmon.php, etc.) I didnt want to post them all here and waste a bunch of space..

    Could some1 contact me and help me track this problem down? I'd like to get the site up and working asap because its a much better design than our current site.

    Thanks
    TimmyC
    TimmyC@5thavenu ebling.com
    Welcome to The Scripts, TimmyC.
    What type of SQL are you using?
    You will need to set the column to be Autoincrement (MySQL) or Identity (MSSQL).

    Comment

    • TimmyC
      New Member
      • Feb 2007
      • 3

      #3
      Thak you for the reply.

      I do believe it to be an autoincrement problem. Do you think the difference between postgreSQL and MySQL would create the problem?

      The cart_id table posts correctly, its just when it tries to reference the cart_items it pulls a null value. Would changing the column from not null help?

      just a few thoughts..

      TimmyC

      Comment

      • Motoma
        Recognized Expert Specialist
        • Jan 2007
        • 3236

        #4
        Originally posted by TimmyC
        The cart_id table posts correctly, its just when it tries to reference the cart_items it pulls a null value. Would changing the column from not null help?
        Yes.

        Sorry for such a short answer.

        Comment

        Working...