Ad Code

Update active inactive status value from table if/else

maybe you only want to filter it by $sid and use CASE to toggle the value of status


UPDATE profile 
SET status = (CASE WHEN status = 'active' THEN 'inactive' ELSE 'active' END)
WHERE id = $id

Post a Comment

0 Comments