If I run this simple query from the console by directly typing
SELECT COUNT(*) AS total FROM articles WHERE MATCH(title) AGAINST (\'+php +mysql\' IN BOOLEAN
You should simply create a statement like this:
$query = 'SELECT COUNT(*) AS total FROM articles WHERE MATCH(title) AGAINST (:query IN BOOLEAN MODE)';
$stmt = $pdo->prepare($query);
And then bind the params:
$keywords = ['php', 'mysql'];
$against = '';
for($i = 0; $i < count($keywords); $i++){
$against .= ' +' . $keywords[$i];
}
$stmt->execute(array(
':query' => $against
));