I have one problem regarding retriving data from database. I have created one database in userrecord and its table name is tbl_user. I am trying to display the user information when they log in the system. i.e view logged user profile. The code is as follows:
<?php
include("auth_user.inc.php"); // authrization page
$uname=$_SESSION['user']; // logged user name
$connection=mysql_connect("localhost","root"," ");
mysql_select_db("userrecord",$connection);
$sql=("select * from table_user where uname ='$uname'");
$result=@mysql_query($sql,$connection);
$row=mysql_fetch_array($result);
?>
<html>
<head>
<title>User Account</title>
</head>
<body bgcolor="#33CCFF">
<br>Your Details Information Is Shown Below:<br><br>
First Name:<?php echo $row['fname'];?><br>
Last Name:<?php echo $row['lname'];?><br>
Address:<?php echo $row['address'];?><br>
E-Mail:<?php echo $row['email'];?><br>
Gender:<?php echo $row['fname'];?><br>
User Name:<?php echo $row['uname'];?><br>
</body>
</html>
The code echo $row[' '] is not displaying the record from database.