I will be a master at this one day. Sorry for the constant questions but I find this forum really helpful.
I have 4 options within my form catagory (selected by populated drop down) and 3 other text boxes say one, two and three.
I am simply trying to populate a drop down box with options from my mysql database. The form is then posted to another php file (completed) which takes the 4 options) and places them into the mysql database.
<form method="post" action="updated1.php">
<p><br />
Catagory:<br />
<select>
<?PHP
error_reporting(E_ALL && ~E_NOTICES);
$link = mysql_connect("hostname","username","password");
mysql_select_db("blc");
$sql="SELECT catagory FROM cats";
$result =mysql_query($sql);
while ($data=mysql_fetch_assoc($result)){
?>
<option value ="<?php echo $data['catagory'] ?>" ></option>
<?php } ?>
<select />
<br />
Company:<br />
<input type="text" name="company" size="30" />
<br />
Description:<br />
<input type="text" name="description" size="30" />
<br />
Discount:<br />
<input type="text" name="value" size="30" />
</p>
<p><br />
<input type="submit" value="update database" />
</p>
</form>
Table for the poplation is called cats and the different options title called catagory.
I think I am also missing a value tag so the updated1.php file knows where to put the value selected from the drop down box.
Thanks Steve