Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2003
    Posts
    4

    Unanswered: help - its 2.30 am :-(

    Trying to update a column in a table based on a value from another heres the code, its late brain hurts...

    anybody help to get it working:

    PLEASE....

    UPDATE tbl_quicksearch
    SET a.Photo= b.Photo_Name
    FROM tbl_quicksearch a, tbl_member_photos b
    WHERE a.Member_ID = b.Member_ID

    Cheers

    Jon.

  2. #2
    Join Date
    Jul 2003
    Posts
    8

    Talking

    try this

    UPDATE tbl_quicksearch
    SET tbl_quicksearch.Photo = tbl_member_photos.Photo_Name
    WHERE tbl_quicksearch.Member_ID = tbl_member_photos.Member_D

    I not test yet.
    Hope it work.

    Cheers,
    LOOI

  3. #3
    Join Date
    Sep 2003
    Posts
    4
    Hi LOOI YS,

    Nope still doesnt work...

    Cheers

  4. #4
    Join Date
    Jan 2003
    Location
    Paris, France
    Posts
    320
    You try to update a table using multiple table

    Code:
    UPDATE tbl_quicksearch
    SET a.Photo= b.Photo_Name
    FROM tbl_quicksearch a, tbl_member_photos b
    WHERE a.Member_ID = b.Member_ID
    You can do it by using this syntax with MySql 4.0.4 and sup


    Code:
    UPDATE tbl_quicksearch,tbl_member_photos SET tbl_quicksearch.Photo=tbl_member_photos.Photo_Name WHERE tbl_quicksearch.Member_ID=tbl_member_photos.Member_ID;
    With other version you need to use your programming language to perform this operation
    Olivier Miossec
    --
    http://www.lasso-developpeur.net/
    --

  5. #5
    Join Date
    Sep 2003
    Posts
    4
    is 4.0.4 the latest production release then? or an alpha dev release

  6. #6
    Join Date
    Jan 2003
    Location
    Paris, France
    Posts
    320
    The latest production release is 4.0.15 so the syntaxe I send you should work with it
    Olivier Miossec
    --
    http://www.lasso-developpeur.net/
    --

Posting Permissions

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