Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2004
    Posts
    2

    Unanswered: Query Statement Help

    I am using a shopping cart and have entered over 700 products and now find out that I am missing one important field and rather than go through the frontend I would like to run a SQL statement to make add the info.

    I have 2 tables...

    Products
    Product_Taxes

    The common field is productid......

    There are only 2 fields in Product_Taxes - productid and taxid.
    I updated 3 products manually through the frontend so I only have 3 entries in the Product_Taxes table.

    What I think I need to do is be able to join the two tables using productid and enter taxid from an update statement.....but I am not sure how to do it.

    Can anyone help me with this?

    Thanks,

    Dalmuti

  2. #2
    Join Date
    Mar 2004
    Posts
    480
    What version of mysql are you using?

  3. #3
    Join Date
    Nov 2004
    Posts
    2
    Hi,

    I am using MySQL 4.0.18. Appreciate any help you can offer.

    Thanks,

    Dalmuti

  4. #4
    Join Date
    Mar 2004
    Posts
    480
    You need 4.0.4 or newer (which you have) to do multi table updates which is why i asked.

    you can just do something like:

    Code:
    UPDATE products, product_taxes
    SET taxid = ???
    WHERE products.productid = product_taxes.productid
    where you would set out the proper info for the taxid if I'm understanding your question correctly.

Posting Permissions

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