0
Hello, I have a project, and I would like that, when the user entered your account, could, through a PHP action, see your basic data, taking only values from that table, here’s what I have so far:
$selec = "SELECT * FROM usuarios";
$selec_query = mysql_query($selec) or die(mysql_error());
$row = mysql_fetch_array($selec_query);
$nome = $row['nomealuno'];
$cidade = $row['cidadealuno'];
$uf = $row['ufaluno'];
$nome = $row['nomealuno'];
$datanasc = $row['datanascaluno'];
echo "Login: ";
echo $row['login'];
echo "<br> Nome: ";
echo "$nome";
echo "<br> Cidade: ";
echo "$cidade";
echo "<br> UF: ";
echo "$uf";
echo "<br> Data de nascimento: ";
echo "$datanasc";
The problem is that appears only the first registered login, and all fields of the tables are with their names, I did not find any problem like mine here, let alone a clear problem in the code.
There’s no missing one
where
in your select?– Jéf Bueno
@jbueno I’ve tried with
where
, could you give me an example?– Jorge Felix
Yes. Before you tell me something, you have the user ID that is logged in saved somewhere, right?
– Jéf Bueno
@jbueno I don’t have, I just have the login cookie, I don’t know how to get the user id automatically, could you show me?
– Jorge Felix