I'm new to PDO (I was forced to choose between mysqli and pdo after migrating php from version 5.2 to 7.0) and I made a system where the user searches:
$b2 = $_POST['b2'];
$busca = $PDO->query("SELECT * FROM noticias WHERE titulo LIKE '%$b2%' UNION SELECT * FROM noticias WHERE corpo LIKE '%$b2%'");
$total->columnCount();
OR
$total->rowCount();
In the end it will be used to display the following information:
A busca retornou <?php echo $total ?> resultados;