sql - Getting rows which include a value with MySQL -


I have a MySQL query that includes some wars:

Message table Receiver Cols

  • user1 rows: 1,3,5
  • user2 rows: 2,3 < / Li>
  • user3 rows: 1,4

I want to get the lines that contain the value '3' so 'user1' and ' User2 '

I tried to do this, but naturally it does not work.

  mysql_query ("SELECT * FROM messages where receiver = '3'");  

How can I do this?

Try this:

  mysql_query (Message from "Select" Where receiver like '% 3%');  

Comments