For a school project I was asked to make a page where I can search for specific records in a database inside a hosting, it turns out that when trying to make the query I always throw this error:
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /home/u538782983/public_html/php/resultado.php on line 9.
This is my code:
<?php
include 'cn.php';
$codigo = $_POST['codigo'];
mysqli_select_db($link, $bd) or die ("Error al conectar a la base de Datos");
$result = mysqli_query($link, "SELECT * FROM registro_cbtis253 WHERE Codigo = '$codigo");
while ($row = mysqli_fetch_array($result)) {
echo $row['Codigo'].$row['nombre_escuela'];
}
?>