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

rating

Binding DataAssist field; error

Thread began 7/22/2010 2:41 pm by robcorrick409194 | Last modified 7/22/2010 2:50 pm by Jason Byrnes | 717 views | 1 replies |

robcorrick409194

Binding DataAssist field; error

I have created a search page using the wizard (public view). I have created a recordset, and all of my database fields are recognized. You can see a copy of my test behavior in the two files below. Is there any other binding that I should be doing?

In Live View, i receive the following error message "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 'WHERE 0=0' at line 1"

The Where statement is actually on line 11. Here is some of the code:

<?php require_once('Connections/localhost.php'); ?>
<?php
//WA Database Search Include
require_once("WADbSearch/HelperPHP.php");
?>
<?php
//WA Database Search (Copyright 2005, WebAssist.com)
//Recordset: Recordset1;
//Searchpage: ;
//Form: ;
$WADbSearch4_DefaultWhere = "WHERE 0=0";
if (!session_id()) session_start();
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$WADbSearch4 = new FilterDef;
$WADbSearch4->initializeQueryBuilder("MYSQL","1");
//keyword array declarations

//comparison list additions
$WADbSearch4->addComparison("Role","".((isset($_GET["S_Role"]))?$_GET["S_Role"]:"") ."","AND","=",0);

//save the query in a session variable
if (1 == 1) {
$_SESSION["WADbSearch4_users_Search"]=$WADbSearch4->whereClause;
}
}
else {
$WADbSearch4 = new FilterDef;
$WADbSearch4->initializeQueryBuilder("MYSQL","1");
//get the filter definition from a session variable
if (1 == 1) {
if (isset($_SESSION["WADbSearch4_users_Search"]) && $_SESSION["WADbSearch4_users_Search"] != "") {
$WADbSearch4->whereClause = $_SESSION["WADbSearch4_users_Search"];
}
else {
$WADbSearch4->whereClause = $WADbSearch4_DefaultWhere;
}
}
else {
$WADbSearch4->whereClause = $WADbSearch4_DefaultWhere;
}
}
$WADbSearch4->whereClause = str_replace("\\''", "''", $WADbSearch4->whereClause);
$WADbSearch4whereClause = '';
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);


I would appreciate any help. Thank you.

Sign in to reply to this post

Jason ByrnesWebAssist

change the default where clause from "WHERE 0=0" to "0=0"

Sign in to reply to this post

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