So I have a code in PHP to display MySQL database information. This is the PHP code:
<?php
$servidor = mysqli_connect ("localhost","root","");
mysqli_select_db($servidor, "produtos");
if (isset($_GET['texto'])) {
$pesquisa = $_GET['texto'];
$query = mysqli_query($servidor, "SELECT * FROM produtos WHERE Nome LIKE '%$pesquisa%' OR Referencia LIKE '%$pesquisa%'");
if(mysqli_num_rows($query) > 0) {
while($resultados = mysqli_fetch_array($query)) {
echo "<h3>Nome: ".$resultados['Nome']."</h3>Referência: ".$resultados['Referencia']."";
}
} else {
echo "<h3>Não foram encontrados resultados!</h3>";
}
}
?>
But right now, that information is displayed in one single line, like this:
and I want to display it in rows, like this:
How can I do this in PHP?
Thank you