-1
I’m trying to make a file in php, which refers to the person’s age and then shows, however, the $login appears to me but the person’s $age does not. I wonder what I’m doing wrong.
<?php
include ("sistema/validar_session.php");
include("config.php");
$login = "Goncalo";
$select = mysql_query("SELECT * FROM dados_usuarios WHERE Login = '$login'");
$consulta = mysql_fetch_array($select);
$idade = $consulta['idade'];
echo "Olá $login a sua idade é de $idade";
?>
Here is the table structure:
Show as this the table of your Database where shows the User Login information
– MarceloBoni
Here is the print: http://prntscr.com/7iahxo
– Gonçalo
can find the error?
– Gonçalo
Gonçalo, enter the relevant code snippet in the body of the question as text. Click [Edit] to do so
– gmsantos
In that case it seems to have no value for
idade
in this record, I see no errors in the code.– rray
Is the record being located? place a
var_dump($consulta;)
at the end of the code to see what appears.– KaduAmaral