I'm quite new to the subject of programming and I'm having problems when it comes to programming my website's search engine.
This is the page where you tell me the error is:
require_once ('../bbdd/bbdd.php');
$search = '';
if (isset($_POST['search'])) {
$search = $_POST['search'];
}
$consulta = "SELECT * from series where nombre LIKE '%".$search."%' ORDER BY DESC LIMIT 20";
$resultado = $conn->query($consulta);
$fila = mysqli_fetch_assoc($resultado);
/*echo $fila['nombre'];*/
$total = msqli_num_rows($resultado);
if ($total >0 && $search != '') {?>
<h2>resultados de la busqueda</h2>
<?php do { ?>
<div class="nombre">
<?php echo $fila['nombre']; ?>
</div>
<?php
} while ( $fila = mysqli_fetch_assoc($resultado)); ?>
<?php }
?>
When I try to execute the query, it gives me two errors:
Warning: mysqli_fetch_assoc () expects parameter 1 to be mysqli_result, boolean given in C: \ xampp \ htdocs \ project \ php \ search.php on line 14
Fatal error: Call to undefined function msqli_num_rows () in C: \ xampp \ htdocs \ project \ php \ search.php on line 18