mysql - How to explode user id from a database column? -


i have table name messages. there column name receiver_id need fetch record receiver_id = 4 getting null output.

see table screenshot-

enter image description here

above screenshot there 3rows. second , third rows exist 4 along other ids need explode , show second , third record.

how write mysql query?

storing comma separated values bad design should normalize first storing association of receiver in junction table,if not able alter schema current situation can use find_in_set() search values in comma separated list

select * table  find_in_set(4,receiver_id ) >0 

Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -