Forum Moderators: coopster
Here is the PHP script:
<?php
$conn = mysql_connect("localhost","","");
mysql_select_db("models",$conn);
$_POST['sex']
$resultID = mysql_query("SELECT * FROM $_POST['sex']",$conn);
print "<table border = 1><tr><th>id</th>";
print "<th>name_first</th><th>name_last</th>";
print "<th>age</th><th>height</th><th>weight</th>";
while ($row = mysql_fetch_row($resultID))
{
print "<tr>";
foreach ($row as $field)
{
print "<td>$field</td>";
}
print "</tr>";
}
print "</table>";
mysql_close($conn);
?>
AND HERE IS MY FORM in HTML
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form1" method="post" action="firstconnect.php">
<select name="sex" id="sex">
<option>--</option>
<option value="male" selected>male</option>
<option value="female">female</option>
</select>
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>