taking information from database and display on textbox

May 7 2016 7:29 PM
I am trying to fix it for 2 hours,but cannot see the informations on textbox. Can you tell me what is wrong ?
 
<?php
$con = mysqli_connect("localhost","root","root");
if (!$con)
{
die('Could not connect: ' . mysqli_error());
}
mysqli_select_db("banka", $con);
$con = mysqli_connect("localhost","root","root");
if (!$con)
{
die('Could not connect: ' . mysqli_error());
}
mysqli_select_db("banka", $con);
$result = mysqli_query( "SELECT * FROM customer WHERE cusid='$_POST[name]'" );
while( $rowval= mysqli_fetch_array( $result ) ){
$cusid= $rowval['cusid'];
$cusname= $rowval['cusname'];
$cussurname= $rowval['cussurname'];
$cususername= $rowval['cususername'];
$cuspassword= $rowval['cuspassword'];
$adress= $rowval['adress'];
$tel= $rowval['tel'];
$trmoney= $rowval['trmoney'];
$dolarmoney= $rowval['dolarmoney'];
}
mysqli_close($con);
?>
<html>
<center><body style = "background-color:yellow;">
<div>
<form action="admin.php" method="post">
<table style="color:purple;border-style:groove; height:150px;width:350px" background="backimage.jpg">
<tr>
<td style=" height:25px; font-family:'Copperplate Gothic Bold'">&nbsp;</td>
</tr>
<tr>
<td style="color:red;background-color:aqua;height:25px">Enter Account no&nbsp;&nbsp;&nbsp;&nbsp;
<input name="name" id="name" type="text"/></td>
</tr>
<tr>
<td style="height:25px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" value="Submit" style="color:white;background-color:brown; height:30px" /></td>
</tr>
</table>
</form>
</div>
<div>
<form >
<table style="color:purple;border-style:groove; height:150px;width:350px">
<tr>
<td style="font-family:Copperplate Gothic Bold">&nbsp;</td>
</tr>
<tr>
<td style="color:red;background-color:aqua;" class="auto-style3">Id:</td>
<td class="auto-style4">
<input id="Text1" name="cusid" type="text" value='<?php echo $cusid; ?>'/></td>
</tr>
<tr>
<td style="color:red;background-color:aqua;" class="auto-style3">Name</td>
<td class="auto-style4">
<input id="Text2" name="cusname" type="text" value='<?php echo $cusname; ?>'/></td>
</tr>
<tr>
<td style="color:red;background-color:aqua;" class="auto-style3">Surname:</td>
<td class="auto-style4">
<input id="Text3" name="cussurname"type="text" value='<?php echo $cussurname; ?>' /></td>
</tr>
<tr>
<td style="color:red;background-color:aqua;" class="auto-style3">Username:</td>
<td class="auto-style4">
<input id="Text4" type="text" value='<?php echo $cususername; ?>' /></td>
</tr>
<tr>
<td style="color:red;background-color:aqua;" class="auto-style3">Password:</td>
<td class="auto-style4">
<input id="Text5" type="text" value='<?php echo $cuspassword; ?>' /></td>
</tr>
<tr>
<td style="color:red;background-color:aqua;" class="auto-style3">Address:</td>
<td class="auto-style4">
<input id="Text6" type="text" value='<?php echo $adress; ?>' ></td>
</tr>
<tr>
<td style="color:red;background-color:aqua;" class="auto-style3">Telephone:</td>
<td class="auto-style4">
<input id="Text7" type="text" value='<?php echo $tel; ?>'/></td>
</tr>
<tr>
<td style="color:red;background-color:aqua;" class="auto-style3">TL amount:</td>
<td class="auto-style4">
<input id="Text8" type="text" value='<?php echo $trmoney; ?>' /></td>
</tr>
<tr>
<td style="color:red;background-color:aqua;" class="auto-style3">Dolar amount:</td>
<td class="auto-style4">
<input id="Text8" type="text" value='<?php echo $dolarmoney; ?>' /></td>
</tr>
<tr>
<td style="height:25px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" value="Submit" style="color:white;background-color:brown; height:30px" /></td>
</tr>
</form>
</div><center>
</body>
</html>
 

Answers (1)