I'm asking you to search the database for a result that matches a url variable I already have, it searches fine, but I want to get another column in the same row as the url it fetched type this:
| enrollment | name |
Search by enrollment, when you find it, take the corresponding name and put the result as the value of a variable. And show me in HTML. Please help me: (
This is an HTML page:
<?php
include ('conecta.php');
$connection = mysqli_connect($host, $user, $pass,$database);
if (!$connection) {
echo ("Servidor temporariamente fora de servi?o");
}
$query = "SELECT * FROM resultado"
. "WHERE nu_mat LIKE ".$url."";
$result = mysqli_query($connection,$query);
if (!$result) {
die("Query invalida na selecao dos dados");
}
while ($dados = mysqli_fetch_array($result,MYSQLI_ASSOC)) {
$dados = ['nm_aluno'];
}
?>
<BODY>
<?php
echo"<p class='texto'>"; echo"$dados"; echo"</p>";
?>
</BODY>