The products recordset would be something like:
<?php
$rs_products = new WA_MySQLi_RS("rs_products",$dmbc_database,0);
$rs_products->setQuery("SELECT * FROM products WHERE visible =1 AND category = ? ORDER BY type, description ASC");
$rs_products->bindParam("s", "".(isset($_GET['categories'])?$_GET['categories']:"") ."", "-1"); //colname
$rs_products->execute();
?>
The type recordset would be something like:
<?php
$rs_type = new WA_MySQLi_RS("rs_type",$dmbc_database,0);
$rs_type->setQuery("SELECT DISTINCT typename, type FROM products WHERE visible =1 AND category = ? ORDER BY type ASC");
$rs_type->bindParam("s", "".(isset($_GET['categories'])?$_GET['categories']:"") ."", "-1"); //colname
$rs_type->execute();
?>
You can update the ATC recordset to:
<?php
$rs_ATC = new WA_MySQLi_RS("rs_ATC",$dmbc_database,0);
$rs_ATC->setQuery("SELECT * FROM products WHERE id IN (?)");
$rs_ATC->bindParam("il", "".(isset($_POST['ATCCheck'])?implode(",",$_POST['ATCCheck']):"") ."", "-1"); //colname
$rs_ATC->execute();
?>
I'm just guessing the category field in your products table is named category and that is the field that the url parameter would match up with. If not, let me know. It would be easier in a screen sharing session because I could ask you about your database structure and verify it works by testing the page. If you do have issues, perhaps you could fill me in more about the database structure and give me FTP access and a URL so I can debug and test the code changes I'm suggesting.