hi all below is my profile.php

<?php
$host="localhost"; 
$username="root";
$password=""; 
$db_name="spl"; 
$tbl_name="registration"; 

mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");


$Username = $_SESSION['Username'];

$result3 = mysql_query("SELECT * FROM registration where Username='$Username'");

while($row3 = mysql_fetch_array($result3))

{ 
$Name=$row3['Name'];

$Age=$row3['Age'];

$Mobilenumber=$row3['Mobilenumber'];

$Address=$row3['Address'];

$Username=$row3['Username'];

$Password=$row3['Password'];

}
?>
<table width="398" border="0" align="center" cellpadding="0">
  <tr>

    <td width="82" valign="top"><div align="left">Name:</div></td>
    <td width="165" valign="top"><?php echo $Name ?></td>

  </tr>
  <tr>
    <td valign="top"><div align="left">Age:</div></td>

    <td valign="top"><?php echo $Age ?></td>

  </tr>
  <tr>
    <td valign="top"><div align="left">Mobilenumber:</div></td>

    <td valign="top"><?php echo $Mobilenumber ?></td>

  </tr>
  <tr>
    <td valign="top"><div align="left">Address:</div></td>

    <td valign="top"><?php echo $Address ?></td>

  </tr>
  <tr>
    <td valign="top"><div align="left">Username: </div></td>

    <td valign="top"><?php echo $Username ?></td>

  </tr>
  <tr>
    <td valign="top"><div align="left">Password: </div></td>

    <td valign="top"><?php echo $Password ?></td>

  </tr>
</table>

but cant get it to work below is the error when run in the browser and notice Username picks up the Name:

Name:

Notice: Undefined variable: Name in C:\wamp\www\Shivam1\profile.php on line 110
Age:

Notice: Undefined variable: Age in C:\wamp\www\Shivam1\profile.php on line 116
Mobilenumber:

Notice: Undefined variable: Mobilenumber in C:\wamp\www\Shivam1\profile.php on line 122
Address:

Notice: Undefined variable: Address in C:\wamp\www\Shivam1\profile.php on line 128
Username:
pP
Password:

Notice: Undefined variable: Password in C:\wamp\www\Shivam1\profile.php on line 140

Is there more to this file? the line numbers are not matching what you have posted?

are you including this file from another file?

Member Avatar for Zagga

Hi pranay1995,

It looks like the errors relate to the code between lines 19 and 29, and is telling you that the columns Name, Age, Mobilenumber, Address, Username and Password do not exist in your database table.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.