close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

1 out of 3 search fields works

Thread began 6/21/2010 12:25 pm by mr hankey | Last modified 6/23/2010 2:24 pm by Eric Mittman | 654 views | 3 replies |

mr hankey

1 out of 3 search fields works

hi,

only search element that works is a select list menu, the other 2 which 1 is a date range does not work, php code generated by data assist:

<?php
//WA Database Search Include
require_once("WADbSearch/HelperPHP.php");
?>
<?php
//WA Database Search (Copyright 2005, WebAssist.com)
//Recordset: WADApipeline;
//Searchpage: product_Results.php;
//Form: form1;
$WADbSearch1_DefaultWhere = "";
if (!session_id()) session_start();
if ((isset($_POST["WADbSearch1"])) && ($_POST["WADbSearch1"] != "")) {
$WADbSearch1 = new FilterDef;
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
//keyword array declarations
$KeyArr0 = array("ClientLastName");
$KeyArr1 = array("Product");

//comparison list additions
$WADbSearch1->addComparisonFromEdit("DueDate","FromDate","AND",">=",2);
$WADbSearch1->addComparison("DueDate","".WAQB_getEndDate($_POST["ToDate"]) ."","AND","<=",2);
$WADbSearch1->keywordComparison($KeyArr0,"".((isset($_POST["ClientLastName"]))?$_POST["ClientLastName"]:"") ."","AND","Includes",",%20","%20","%22","%22",0);
$WADbSearch1->keywordComparison($KeyArr1,"".((isset($_POST["Product"]))?$_POST["Product"]:"") ."","AND","Includes",",%20","%20","%22","%22",0);

//save the query in a session variable
if (1 == 1) {
$_SESSION["WADbSearch1_product_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_product_Results"]) && $_SESSION["WADbSearch1_product_Results"] != "") {
$WADbSearch1->whereClause = $_SESSION["WADbSearch1_product_Results"];
}
else {
$WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;
}
}
else {
$WADbSearch1->whereClause = $WADbSearch1_DefaultWhere;
}
}
$WADbSearch1->whereClause = str_replace("\\''", "''", $WADbSearch1->whereClause);
$WADbSearch1whereClause = '';
?>

my form:

<form name="form1" action="product_Results.php" method="post">
<table cellpadding="2" cellspacing="0" border="0">
<tr>
<td align="right"><label >Due Date Range From:</label></td>
<td><input type="text" name="FromDate" value="" />
&nbsp;
<label>To:</label>
&nbsp;
<input type="text" name="ToDate" value="" />
&nbsp;(mm/dd/yyyy)</td>
</tr>
<tr>
<td align="right"><label for="ClientLastName">Client Last Name:</label></td>
<td><input type="text" name="ClientLastName" value="" /></td>
</tr>
<tr>
<td align="right"><label for="Product">Product:</label></td>
<td><select name="Product">

<option value="product1">product1</option>
<option value="product2">product2</option>
</select></td>
</tr>
<tr>
<td align="center" ><input type="submit" name="WADbSearch1" value="Search" /></td>
</tr>
</table>
</form>

my search form is on my results page.

tried deleting the behaviour and going through the wizard again but still no joy.

thanks

Sign in to reply to this post

Eric Mittman

In regards to the searches that you have setup that are not working how are they configured in the DataAssist Search server behavior that is on the results page? Please review how they are setup, and include information about these columns in your db and what you are shooting for as an end result.

Sign in to reply to this post

mr hankey

hi Eric,

End Result:

i want the other 2 search fields to work, at moment it just gives me no results.

the setup of the data assist is on my original post. that is what it produced.

date range is a date column type, client last name is a varchar column type in database.

thanks

Sign in to reply to this post

Eric Mittman

Please post back with the page in question, a copy of your db, and your WA_DataAssist folder from your site in a zip archive. Along with this please also describe how you have currently configured the criteria for this particular search that is not working. I will use your files and info to try and determine what needs to be done to make it work.

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