データ テーブルからすべての行のデータを取得しようとしています。ここで、1 つの単語が「ストーリー」列のテキスト内の単語と一致します。
テーブル構造:
post_id | user_id | story
----------------------------------
1 | 1 | Hello World What's up?
2 | 4 | Hello guys!
3 | 7 | Working on shareit.me!
例えば:
hello という単語を含むすべての投稿を取得したいと考えています (大文字と小文字を区別しないものを探しています)。
これどうやってするの?
これが私がこれまでに行ったことです:
// this will be the keyword! so use the variable $filter_tag in the query!
$filter_tag= $_GET['tag'];
//query for getting the users' posts containing the select tag
$query_posts= "SELECT * FROM posts WHERE user_id= '$user_id' ORDER BY post_id
DESC";
$result_posts= mysqli_query($connect, $query_posts);
ありがとう!