Thanks Jason,
Yes, I have tried that. And just tried it again. I do have a URL variable set in the bindings called Status. And I have a column in the table called status.
I get this error every time I include any type of WHERE...
"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Status=2 ORDER BY status ASC LIMIT 0, 100' at line 1"
It doesn't matter if I have Status=2, Status=0, 0 <> 0 or 0=0, I still get a similar error.
Maybe I have something else set wrong. I totally removed the search behavior and started from scratch. Here's the top half of the search behavior. (if you need more, let me know.)
$WADbSearch1_DefaultWhere = "Status=2";
if (!session_id()) session_start();
if ((isset($_GET['Status']) && $_GET['Status'] != "")) {
$WADbSearch1 = new FilterDef;
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
//keyword array declarations
$KeyArr1 = array("status");
//comparison list additions
$WADbSearch1->keywordComparison($KeyArr1,"".$_GET['Status'] ."","AND","=",",%20","%20","%22","%22",0);
//save the query in a session variable
if (1 == 1) {
$_SESSION["WADbSearch1_test"]=$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_test"]) && $_SESSION["WADbSearch1_test"] != "") {
If I append the url with ?Status=0 or ?Status=1 etc. it works just fine and the error goes away. AND!! I can even go back to the original url and refresh getting no error but only getting the results from the last link clicked. Telling me that the session is not being set in the first visit to the page.
I have the search behavior at the top of the page with the require_once("WADbSearch/HelperPHP.php"); above that.
Any thoughts? What do I have set wrong? Do I need some way of setting this session differently than I have now?
Thanks,
TroyD