php - Checking for string match with a MySQL query -


i trying grab rows of data data table, 1 word matches word within text in column 'story'.

table structure:

post_id | user_id | story ---------------------------------- 1       | 1       | hello world what's up? 2       | 4       | hello guys! 3       | 7       | working on shareit.me!  

for example:

i want grab of posts containing word hello (i looking case-insensitive).

how can this?

here have done far:

// keyword! use variable $filter_tag in query! $filter_tag= $_get['tag'];  //query getting users' posts containing select tag  $query_posts= "select * posts user_id= '$user_id' order post_id  desc";  $result_posts= mysqli_query($connect, $query_posts);  

thanks!

 $query_posts= "select * posts user_id= '$user_id' , story '%$filter_tag%' order post_id      desc"; 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -