Hello..
I would like to modify a script i have that queries and displays all the relative data for a chosen ID from a drop down menu to a form that contains the drop down menu and then checkboxes with the specifics the user would like to query. I have searched extensibly on the web for this over the last few hours but haven't really found much regarding querying with checkboxes but more with inserting with checkboxes.. I am assuming i need to create an array that will have the column names (checkbox values) in which to build the query on the specific ID. something like Select $array, from server_history where ID = "server_ID". Then I would pass these variables to the sec_rec3.php file. As you can guess I am at a loss as to where to start.. Below is the code.. any hints on the coding for check boxes and array would be helpful..
<HTML>
<BODY>
<CENTER><B> Query Server INFO </B></CENTER>
<?php
include file
include ("magops_info.php");
$sql="SELECT name,server_ID FROM servers";
$mysql_result=mysql_query($sql,$connection);
$num_rows=mysql_num_rows($mysql_result);
if ( $num_rows == 0 ) {
echo "Sorry there is no information";
} else {
we have records
echo "<FORM METHOD=GET ACTION=\"see_rec3.php\">";
echo "Please select a server <BR>";
echo "<SELECT name=\"rec_ID\">";
while ($row=mysql_fetch_array($mysql_result))
{
$name=$row["name"];
$ID=$row["ID"];
display results
echo "<OPTION VALUE=\"$row[server_ID]\" >$row[name]" ;
}
echo "</SELECT>";
} # end else
echo " <BR><BR>";
echo "<INPUT TYPE=\"SUBMIT\" VALUE=\"View the details !\">";
echo "<INPUT TYPE=\"RESET\" VALUE=\"Clear me!\">";
mysql_close($connection);
?>
</FORM>
</BODY>
</HTML>