0
// esta é uma pagina separada, chamada adicionar_consulta.php
<?php
$conexao = new mysqli("localhost","root","","hospital");
if ($conexao->connect_errno) {
echo "Failed to connect to MySQL: (" . $conexao->connect_errno . ") " .
$conexao->connect_error;
}
$res = $conexao->query("SELECT nome,idade
FROM paciente, ficha_atendimento
WHERE paciente.id = ficha_atendimento.id_paciente
AND ficha_atendimento.id IN (SELECT MIN(id) FROM
ficha_atendimento)
AND ficha_atendimento.status IS TRUE");
while ($row = $res->fetch_assoc()) {
echo " id = " . $row['nome'] . " " . $row['idade']. "</br>";
}
?>
I want to show the data of this query in PHP on the same page where is the button that makes the call. This above code is the query script. When you press the button it is performed, but a redirect to another page occurs.
Start by placing the page that calls this query...
– MagicHat