1
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 made a system where the user does the search:
$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();
At the end will be used to display the following information:
A busca retornou <?php echo $total ?> resultados;
columnCount() returns the number of columns, and rowCount() returns the number of records ( Lines ).
– NoobSaibot