Hai can any tel me , How i can get username from database where i logged in using userid . here is the code below.
if(isset($_SESSION['u_name'])){
include 'dbcon.php';
$qry = "SELECT * FROM tbl_user where user_id='".$_SESSION['u_name']."'";
$result = mysql_query($qry,$con);
if($result)
{
$row=mysql_fetch_array($result);
}
while($row=mysql_fetch_array($result))
{
echo ' Welcome ' .$row['user_name'];
}
}
i want to display only the username of the person who logged in using his userid. The above code displays nothing.