Check Boxes - When single ones selected works fine but not when multiple selected
Have resolved my last reply issue, but now have another one! X
Have created multiple check boxes to look at one field in the main table recordset.
When each selected singularly the check boxes show the correct results. The problem is when more than one check box is ticked. I am using the DATA Assist Search Server Behaviour and the code is posted below:
<?php
//WA Database Search (Copyright 2005, WebAssist.com)
//Recordset: WADAproperties;
//Searchpage: properties_Search.php;
//Form: WADASearchForm;
$WADbSearch1_DefaultWhere = "";
if (!session_id()) session_start();
if ((((isset($_GET["submit"]))?$_GET["submit"]:"") != "")) {
$WADbSearch1 = new FilterDef;
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
//keyword array declarations
$KeyArr1 = array("PropertyType");
//comparison list additions
$WADbSearch1->addComparisonFromEdit("PropertyType","Assembly","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("PropertyType","HealthDay","AND","Includes",0);
$WADbSearch1->addComparisonFromList("SaleORLease","status","AND","=",0);
$WADbSearch1->addComparisonFromEdit("RegionName","region","AND","Includes",0);
$WADbSearch1->keywordComparison($KeyArr1,"".((isset($_GET["Industrial"]))?$_GET["Industrial"]:"") ."","AND","Includes",",%20","%20","%22","%22",0);
$WADbSearch1->addComparisonFromList("PropertyType","Investment","AND","Includes",0);
$WADbSearch1->addComparisonFromList("PropertyType","Land","AND","=",0);
$WADbSearch1->addComparisonFromList("PropertyType","Licenced","OR","Includes",0);
$WADbSearch1->addComparisonFromList("PropertyType","Mixed","AND","Includes",0);
$WADbSearch1->addComparisonFromList("PropertyType","Motor","AND","Includes",0);
$WADbSearch1->addComparisonFromList("PropertyType","Office","AND","Includes",0);
$WADbSearch1->addComparisonFromList("PropertyType","Residential","AND","Includes",0);
$WADbSearch1->addComparisonFromList("PropertyType","Retail","AND","Includes",0);
$WADbSearch1->addComparisonFromList("PropertyType","Storage","AND","Includes",0);
$WADbSearch1->addComparison("RegionName","".((isset($_GET["region"]))?$_GET["region"]:"") ."","AND","=",0);
$WADbSearch1->addComparison("SaleORLease","".((isset($_GET["status"]))?$_GET["status"]:"") ."","AND","=",0);
//save the query in a session variable
if (1 == 1) {
$_SESSION["WADbSearch1_properties_Results"]=$WADbSearch1->whereClause;
}
}
else {
$WADbSearch1 = new FilterDef;
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
//get the filter definition from a session variable
if (1 == 1) {
if (isset($_SESSION["WADbSearch1_properties_Results"]) && $_SESSION["WADbSearch1_properties_Results"] != "") {
$WADbSearch1->whereClause = $_SESSION["WADbSearch1_properties_Results"];
}
else {
$WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;
}
}
else {
$WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;
}
}
$WADbSearch1->whereClause = str_replace("\\''", "''", $WADbSearch1->whereClause);
$WADbSearch1whereClause = '';
?>
Can you see where the problem lies ?
Many thanks