I've figured out how to make the fields auto populate from the sql. The problem now is the page keeps reposting the form over and over again. I think it has to do with this line, but when I change it, the fields don't auto populate.
while(list($id, $name, $dis, $icon, $maker, $date) = mysql_fetch_array($result))
What am I missing here?
<head>
<style type="text/css">
a {
color: #008000;
}
a:visited {
color: #008000;
}
a:active {
color: #008000;
}
a:hover {
color: #008000;
}
</style>
</head>
<html>
<?php
include 'inc/config.php';
include 'inc/opendb.php';
$query = "SELECT id, name, dis, icon, maker, date FROM upload";
$result = mysql_query($query) or die('Error, query failed');
if(mysql_num_rows($result) == 0)
{
echo "Database is empty <br>";
}
else
{
while(list($id, $name, $dis, $icon, $maker, $date) = mysql_fetch_array($result))
{
?>
<center>
<body bgcolor="Black" style="color: #008000">
<input type="hidden" name="id" value="<?=$_REQUEST['id'] ?>">
<strong class="font"><span class="style2">Name:</span></strong><span class="style4"><strong><br />
<input type="text" name="name" size="30" value="<?=$dis;?>"><br>
</strong></span>
<strong class="font"><span class="style2">Icon:</span></strong><span class="style4"><strong><br>
<input type="text" name="icon" size="30" value="<?=$icon;?>"><br>
</strong></span>
<strong class="font"><span class="style2">Maker:</span></strong><span class="style4"><strong><br />
<input type="text" name="maker" size="30" value="<?=$maker;?>"><br>
</strong></span>
<strong class="font"><span class="style2">Date:</span></strong><span class="style4"><strong><br />
<input type="text" name="date" size="30" value="<?=$date;?>"><br>
</strong></span>
<?php
}
}
include 'inc/closedb.php';
?>
</body>
</html>