Apparently you are typing in spaces, thinking that will show us what field a value is in. But spaces are IGNORED in HTML, so we just see what you would see if you looked at your own post.
To preserve spaces, wrap those parts of your post in [ code ] .... [ /code ] tags.
I am *GUESSING* that you mean:
Code:
EXISTING RECORD:
Actor Director Producer
xx xx Tarantino
Then *IF* the fields given are:
$role = director
and
$person = tarantino
THAT SHOULD BECOME:
Actor Director Producer
xx Tarantino Tarantino
Yes??? You don't say what to do with the field that the name was moved *FROM*, so I'm just leaving it as is.
So... let's think about it...
Code:
UPDATE table
SET $role = '$person'
WHERE $role != '$person'
AND '$person' IN ( Actor, Director, Producer )
I think that works. It first looks for all records where 'Tarantino' is *NOT* the Director and then for all records where 'Tarantino' *IS* either actor or director or producer. (Naturally, the fact that we check director in the second test is essentially ignored because of the first test.) When it finds such a record, it changes the Director to be, as you asked, 'Tarantino'.