Hi,
I have a page where I need to show the users name from a table called users. Their name is stored under a column called real_name. I am also passing a session variable called user_name which is equivalent to their username they input to log into the system. When I try to use the code below, I get no errors however NOTHING shows up at all. Its just blank.
require '../globals/dbconnect.php';
$user_name = $_SESSION['user_name'];
$result = mysql_query("SELECT real_name FROM users WHERE real_name = '$user_name'");
//then call the query and display it
while ($row = mysql_fetch_array($result)) {
printf("%s", $row["real_name"]);
Now I'm pretty sure that my error is in the WHERE statement because I removed it and the $row will return a the first row from the real_name column. Suggestions?