close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Search Behavior WHERE question.

Thread began 2/14/2011 12:32 am by troyd | Last modified 2/15/2011 5:34 am by troyd | 1644 views | 14 replies

troyd

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.)

php:
$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

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...