Hi!
I am new here. I am new in php too..
Can somebody help me in solve this error?
I can go to the page that but cannot call the data from the database.
This is my code:
<?php
$con = mysql_connect("localhost","root","root");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("pqs", $con);
$ref1 = $_REQUEST['$ref1'];
$result = mysql_query("SELECT * FROM userdb WHERE User_tcno = '$ref1' LIMIT 1");
?>
<form name="form1" method="post" action="view_user.php">
<p> </p>
<?php while($row = mysql_fetch_array($result))
{
?>
<table width="545" border="0" align="center" bordercolor="#F0F0F0">
<tr bordercolor="#F0F0F0" bgcolor="#FFFFFF">
<th width="196" scope="col"><div align="right" class="style9">User TC No. </div></th>
<th width="5" scope="col"><div align="center"><strong>:</strong></div></th>
<th width="330" scope="col"><div align="left"><?php echo $row['User_tcno']; ?></div></th>
</tr>
<tr bordercolor="#F0F0F0" bgcolor="#FFFFFF">
<th scope="row"><div align="right" class="style9">User Name </div></th>
<td><div align="center"><strong>:</strong></div></td>
<td><div align="left"><?php echo $row['User_name']; ?></div></td>
</tr>
<tr bordercolor="#F0F0F0" bgcolor="#FFFFFF">
<th scope="row"><div align="right" class="style9">Department</div></th>
<td><div align="center"><strong>:</strong></div></td>
<td><div align="left"><?php echo $row['User_dep']; ?></div></td>
</tr>
<tr bordercolor="#F0F0F0" bgcolor="#FFFFFF">
<th scope="row"><div align="right" class="style9">Access Username </div></th>
<td><div align="center"><strong>:</strong></div></td>
<td><div align="left"><?php echo $row['User_username']; ?></div></td>
</tr>
<tr bordercolor="#F0F0F0" bgcolor="#FFFFFF">
<th scope="row"><div align="right" class="style9">Access Password </div></th>
<td><div align="center"><strong>:</strong></div></td>
<td><div align="left"><?php echo $row['User_passsword']; ?></div></td>
</tr>
<tr bordercolor="#F0F0F0" bgcolor="#FFFFFF">
<th height="24" scope="row"><div align="right" class="style9">Access Level </div></th>
<td><div align="center"><strong>:</strong></div></td>
<td><div align="left"><?php echo $row['User_level']; ?></div></td>
</tr>
<?php }?>
<tr bordercolor="#F0F0F0" bgcolor="#FFFFFF">
<th colspan="3" scope="row"><div align="right"></div></th>
</tr>
<tr bordercolor="#F0F0F0" bgcolor="#FFFFFF">
<th height="44" colspan="3" scope="row"><div align="center">
<input name="print" type="submit" id="print" value="Print" onclick="window.print();" />
<input name="close" type="submit" id="close" value="Close" onclick="" />
</a>
</div></th>
</tr>
</table>
<?php
mysql_close($con);
?>
<p> </p>
<div id="footer">
<p align="left"><strong>Access Level description:</strong><br />
Level 1 : Admin page<br />
Level 2 : HRA page<br />
Level 3 : Guard Page </p>
</div>
</form>
<p></p>
Thanks in advance!Really need your help.. :)