Bạn có thể thử cái này -
UPDATE users SET eat = REPLACE(eat, 'banana', '') where eat like '%banana%';
Điều này sẽ chỉ thay thế banana từ eat cột nơi nó hiện diện.
Cập nhật
Lặp qua dữ liệu và thay thế các giá trị đó. Điều này có thể hữu ích -
$check_val = 'banana';
//select those rows first
"select id, eat from users where eat like '%" . $check_val . "%'"
foreach($data as $v) {
$temp= explode(',', $v['eat']);
$temp= array_map(function($t) use($check_val) {
return (strpos($t, $check_val) !== false) ? null : $t;
}, $temp);
$temp = array_filter($temp);
$v['eat']= implode(',', $temp);
"update users set eat= '" . $v['eat'] . "' where eat like '%" . $check_val . "%'"
}