textbox list the data from database
Posted: Sun Apr 12, 2009 10:29 am
i want the text field to list the data from the column called username from the database ....but the textbox is not listing anything below is the code...plz tell me where i m going wrong.
Code: Select all
<body>
<?php
$username = 'username';
$usernamevalue = array();
$i=0;
$query_name = "SELECT users.username FROM users ";
$result = mysql_query($query_name);
confirm_query($result);
while ($record = mysql_fetch_assoc($result)) {
while (list($username, $usernamevalue) = each ($record)) {
//echo $username.": <B>".$usernamevalue."</B><BR>";
echo <input type="text" name="username" maxlength="23" value=" htmlentities($usernamevalue)" />;
}
echo "<BR>";
}
?>
<form action="admin_account.php" method="post">
<div style="position: absolute; width: 100px; height: 32px; z-index: 1; left: 225px; top: 35px" id="layer2">
<td><input type="text" name="username" maxlength="23" value="<?php echo htmlentities($usernamevalue); ?>" /></td>
</div>
</form>
</body>