Hello, thanks for the reply!
I have come up with this so far...
It is a page with question - What avail? Then is drop down list with availmon-->availsun
next question -- What area? Then drop down with areas in a restaurant.
Then is a submit button in which I would like to create a query from the selected values from each of the drop down lists.
Code:
<?php
/* Requires the header and the header
requires config.php */
require("header.php");
if($_POST['submit']) {
$db = mysql_connect($dbhost, $dbuser, $dbpassword);
mysql_select_db($dbdatabase, $db);
}
echo mysql_error();
?>
<br/>
<br/>
<div id="main">
<h3>Employee Search</h3>
<?
echo "<br>";
$fieldavail = mysql_list_fields("sch", "avail", $db);
$colavail = mysql_num_fields($fieldavail);
echo "<p>What day ?</p>";
echo "<form action='xxx.php' method='POST'><select name ='$avail'>";
for ($i = 1; $i < $colavail; $i++) {
echo "<option value=$i>";
echo mysql_field_name($fieldavail, $i);
}
echo "</select></form>";
echo "<br>";
$fieldarea = mysql_list_fields("sch", "area", $db);
$colarea = mysql_num_fields($fieldarea);
echo "<p>What area ?</p>";
echo "<form action=xxx.php method=POST><select name ='$area'>";
for ($i = 1; $i < $colarea; $i++) {
echo "<option value =$i>";
echo mysql_field_name($fieldarea, $i);
}
echo "</select></form>";
echo "<br><br>";
echo "<input type=\"submit\" name=\"submit\" value=\"Search employees\">";
?>
</select>
</form>
</div>
<!--
<td></td>
<td><input type="submit" name="submit" value="Search employees"></td>
-->
Now when /i click search i get nothing. I would atleast expect a notfound error since "xxx.php" does not exist!
do i need a <form> tags outside of my php?
can you help?!
-justin