hi all below is my profile.php


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))







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

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

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

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

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

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

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

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

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

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

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

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


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


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

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

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

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

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

Recommended Answers

All 2 Replies

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

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, learning, and sharing knowledge.