I am trying to update using if which is shown below
you will get idea what i want to do
UPDATE messages SET IF(u1= :username,u1_delete=1,u2_delete=1)
WHERE thread_id= :thread_id
i want update u1_delete when u1 is username otherwise it will update u2_delete field
You can use the case statement as follows: