I am trying to show the user logged in his information that he added at time of register. I have been pulling code from the internet and would like to understand it better so I can fix things on my own.
Currently when you log in it displays the most recent persons information that has registered on the site instead of showing the persons information that just logged in.
I do not understand what variables are being assigned and how exactly im telling the variable that it now stands for what ever row im attaching it to.
This is my code that is displaying the wrong information. Please explain each line and code such as whats a variable and whats just an embedded command. Then if you could explain why it is showing the information from who last registered instead of the person currently logged in...
$link = mysql_connect("localhost", "root", "");
if (! $link)
die("Couldn't connect to MySQL");
mysql_select_db($db , $link)
or die("Couldn't open $db: ".mysql_error());
$result = mysql_query( "SELECT * FROM users" )
or die("SELECT Error: ".mysql_error());
$num_rows = mysql_num_rows($result);
while ($i<$num_rows )
echo "<b>Username: $username</b><br>Phone: $phone<br>Mobile: $mobile<br>E-mail: $email<br>Web: $web<br><hr><br>";