I have a form with select boxes, populated from Mysql, and check boxes- about 24 in total. Aim is to produce a query that returns values from mysql depending on values selected, and checkboxes clicked(click value "Yes". Form to select works fine, select boxes populated from mysql. But form handler is failing. I have reduced to try just one value from single select box. How do I manage to run a query based on values selected or checked. The form is posted using Get but cannot retreive selection of just one, and need to run a query based on all selected values in form. ($num==00) echo'no records found) also failed. Db connection is fine. I have searched the Net but no obvious help.
Charles
handle form is:
<?php require_once('Connections/dbcompstore.php'); ?>
<?php
// Set the page title and include the HTML header.
$page_title = 'EPOS and Cash Register Selection';
include_once ('header2.html');
?>
<?PHP
$business_type = "";
if (isset($_GET['business_type'])) {
$business_type = $_GET['business_type'];
}
$sql = "SELECT * FROM cashreg WHERE model ='business_type'";
$result = mysql_query($sql);
echo "<TABLE ALIGN=\"CENTER\"BORDER=\"3\">";
echo "<tr> <th>id</th><th>model</th> <th>business_type</th> <th>no_depts</th> <th>no_plustan</th><th>no_plumax</th>
<th>no_pricesplu</th><th>no_charactplu</th><th>no_preset</th><th>print_type</th><th>print_receipt</th><th>scanner</th>
<th>pc_connect</th><th>modem</th><th>no_clerks</th><th>network</th><th>no_network</th><th>touch_screen</th>
<th>key_type</th><th>clerk_interrupt</th><th>customer_disp</th><th>kitchen_printer</th><th>bill_following</th><th>produce_barcode</th>
<th>financial_report</th><th>serial_port</th><th>currency_conv</th><th>logo_receipt</th><th>auto_vat</th></tr>";
while ($row = mysql_fetch_array($result)) {
$id=$row['id'];
$model=$row['model'];
$business_type=$row['business_type'];
$no_depts=$row['no_depts'];
$no_plustan=$row['no_plustan'];
$no_plumax=$row['no_plumax'];
$no_pricesplu=$row['no_pricesplu'];
$no_charactplu=$row['no_charactplu'];
$no_preset=$row['no_preset'];
$print_type=$row['print_type'];
$print_receipt=$row['print_receipt'];
$scanner=$row['scanner'];
$pc_connect=$row['pc_connect'];
$modem=$row['modem'];
$no_clerks=$row['no_clerks'];
$network=$row['network'];
$no_network=$row['no_network'];
$touch_screen=$row['touch_screen'];
$key_type=$row['key_type'];
$clerk_interrupt=$row['clerk_interrupt'];
$scale_link=$row['scale_link'];
$customer_disp=$row['customer_disp'];
$kitchen_printer=$row['kitchen_printer'];
$bill_following=$row['bill_following'];
$produce_barcode=$row['produce_barcode'];
$financial_report=$row['financial_report'];
$serial_port=$row['serial_port'];
$row['currency_conv'];
$logo_receipt=$row['logo_receipt'];
$auto_vat=$row['auto_vat'];
echo
"<TR><TD>$id</TD><TD>$model</TD><TD>$business_type</TD><TD>$no_depts</TD><TD>$no_plustan</TD>
<TD>$no_plumax</TD><TD>$no_pricesplu</TD><TD>no_charctplu</TD><TD>$print_type</TD><TD>$scanner</TD>
<TD>$pc_connect</TD><TD>$modem</TD><TD>$no_clerks</TD><TD>$network</TD><TD>$touch_screen</TD>
<TD>$key_type</TD><TD>$clerk_interrupt</TD><TD>$scale_link</TD><TD>$customer_disp</TD><TD>$kitchen_printer</TD>
<TD>$bill_following</TD><TD>$produce_barcode</TD><TD>$financial_report</TD><TD>$serial_port</TD>
<TD>$currency_conv</TD><TD>$logo_receipt</TD><TD>$auto_vat</TD</TR>";
}
mysql_close();
?>
</Table>
</body>
</html>