$words = array('Привет', 'привет', 'Хай', 'хай', 'Хэй', 'Хэллоу');
$impl = implode('%', $words);
$where = "TEXT LIKE '%{$impl}%'";
$query= $mysqli->query("select id, name from projects limit 5");
while($project = $query->fetch_assoc()){
$news_query = $mysqli->query("select * from news where `project_id` = {$project[id]} order by `pubdate` desc limit 5");
while($news = $news_query ->fetch_assoc()){
echo $news['title'];
}
}