Will only one category be passed in through the url at a time? If so, you can just use:
<?php
$rs_products = new WA_MySQLi_RS("rs_products",$dmbc_database,0);
$rs_products->setQuery("SELECT * FROM products WHERE visible =1 AND category LIKE ? ORDER BY type, description ASC");
$rs_products->bindParam("c", "".(isset($_GET['categories'])?$_GET['categories']:"") ."", "-1"); //colname
$rs_products->execute();
?>
and
<?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 LIKE ? ORDER BY type ASC");
$rs_type->bindParam("c", "".(isset($_GET['categories'])?$_GET['categories']:"") ."", "-1"); //colname
$rs_type->execute();
?>