Results 1 to 2 of 2

Thread: MySQL Problem

  1. #1
    Join Date
    Aug 2004
    Posts
    4

    Unanswered: MySQL Problem

    Can someone tell me the correct syntax for this query:

    Code:
    UPDATE products SET products.cat = cat2.cat_desc WHERE cat2.id = products.cat

  2. #2
    Join Date
    Jul 2004
    Location
    Dundee, Scotland
    Posts
    107
    your syntax would work if you weren't trying to reference the cat2 table... i.e. with that syntax you can just reference fields in the products table using the WHERE clause.

    try:
    UPDATE `products`,`cat2`
    SET products.cat=cat2.cat_desc
    WHERE cat2.id = products.cat

    http://dev.mysql.com/doc/mysql/en/UPDATE.html

Posting Permissions

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