1
I am asking to search in the database a result equal to a variable url that I already have, it looks right, but I want to pick another column in the same row of the url that it was looking for like this:
| registration | name |
search by matricule, when finding, takes the corresponding name and puts the result as the value of a variable. And shows me in HTML. Help me please :(
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>
after in html I ask to show and does not show me anything
– Sarah
html does not seem to be in question.
– rray
<?php 
 echo"<p class='texto'>"; echo"$dados"; echo"</p>";
 ?>
– Sarah
edited the question
– Sarah