1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Rep Power
    I'm trying to make a MySQL query through PHP to update a field in one table with the value in another table.

    The query i've been trying (and doesn't work) is:

    UPDATE tableA,tableB SET tableA.fieldA=tableB.fieldB WHERE tableA.idA=tableB.idB AND tableA.dateA<55555

    I'm trying to set fieldA in tableA to equal fieldB in tableB for each of the rows where dateA in tableA is < 55555. I'm linking the two tables with the idA and idB fields.

    Any idea how to do this?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Rep Power
    As far as Iīve heard, this canīt be done in MySQL with the UPDATE command.
  4. #3
  5. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Caro, Michigan
    Rep Power
    I seem to remember hearing that somewhere too. It may depend on your version, though, so just try the update command like you said and see if it works. If it doesn't, and you have the latest stable version, then your only option will be multiple commands, select then update...


Similar Threads

  1. Help!! can't find any fields in table xxx
    By outdateboy in forum MySQL Help
    Replies: 2
    Last Post: February 15th, 2004, 02:28 PM
  2. are table names in hidden fields wise?
    By arrival5 in forum PHP Development
    Replies: 4
    Last Post: February 14th, 2004, 09:31 AM
  3. League table problem
    By silverduck in forum MySQL Help
    Replies: 8
    Last Post: February 10th, 2004, 12:38 PM
  4. Replies: 1
    Last Post: January 30th, 2004, 06:04 PM
  5. how to keep table on top, not centered??
    By vinyl in forum HTML Programming
    Replies: 2
    Last Post: January 20th, 2004, 06:19 PM

IMN logo majestic logo threadwatch logo seochat tools logo