Hi,
I am trying to display the users email address when they login to there account on there profile page..
I have successfully done this for there username as i use $_COOKIE to display the users name with the DB.
Problem is i am not sure how to do it for email address. Here is my query:
<p><b>Your email address is:</b></p>
<?php
$query3 = mysql_query("SELECT * FROM userinformation WHERE username = '$username' AND email = 'email'");
while($row = mysql_fetch_array($query3)){
echo "email";
}
?>
As you can see i am trying to get the query to understand that i want the email address from the user who username = $username.
But i am sure i am telling it wrong, as i think where i have email = 'email' it is trying to find data in the email field called email.
I am not sure how i get it to understand to get the email address that is assocaited with the username, the username works fine as it gets this from the $_COOKIE as the username and password is stored on users computer as a cookie.
any help much appreciated.
Thanks as always,
genieuk