I am getting the following error... everthing shows up on the page but the dropdown is not populated and directly after it I get this error:
Warning/Library/WebServer/Website/sql/sqltest2.php19
Thanks for all the Help.
The new code I am using is :
<body>
<?php
if ($submit) {
// process form
$db = mysql_connect("localhost", "root", "database");
mysql_select_db("litreview",$db);
$sql = "INSERT INTO books (Author,Title,Publisher,Subject,Level,OrderNum,ReadStrat1) VALUES ('$Author','$Title','$Publisher','$Subject','$Level','$OrderNum','$ReadStrat1')";
$result = mysql_query($sql);
echo "Thank you! Information entered.\n";
} else{
// display form
?>
<form method="post" action="<?php echo $PHP_SELF?>">
Author:<input type="Text" name="Author"><br>
Title:<input type="Text" name="Title"><br>
Publisher:<input type="Text" name="Publisher"><br>
Subject:<input type="Text" name="Subject"><br>
Level:<select name="Level">
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
</select><br>
Order Number:<input type="Text" name="OrderNum"><br>
<select name="ReadStrat1">
<?php
mysql_query("SELECT * FROM strats");
while ($myrow = mysql_fetch_array($result))
{
printf("<option value='$myrow[ID]'>$myrow[strats]</option>");
}
?>
</select>
<input type="Submit" name="submit" value="Enter information">
</form>
<?php
} // end if
?>
</body>