You can use this query:
Query:
mysql_query("SELECT *
FROM `table`
WHERE `column` LIKE '%{$needle}%' ");
Want to learn SQL from scratch? Here's is the right video for you on SQL provided by Intellipaat
Here, ‘ %’ is a wildcard that is used for any character.
Note: For very large datasets this can get slow. So, if your database grows then you need to use fulltext indices.