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

Weird search behavior

Thread began 4/26/2010 6:04 pm by president310264 | Last modified 5/07/2010 7:18 pm by Jimmy Wu | 1540 views | 14 replies |

president310264

Weird search behavior

I have a site where I used dataassist to create s imple search and results page(s) for my customer. Their end users can simply input a zip code and all of the locations where their product can be purchased within that zip code display (I also integrated this with the google map extension).

Here is the odd behavior...The first time someone opens IE (I have been unable to duplicate this in firefox), they type in the zip and hit enter, it displays the first twelve or so entries from the db instead of the ones from that area (although it is included in the result). If they click the button with their mouse, it works fine and if they come back and try again, it works fine. It is really weird.

Thoughts?

~Clay

Sign in to reply to this post

Jimmy Wu

Do you have a url where we can test this behavior?

Sign in to reply to this post

president310264

Absolutely...

customersearch.php

FOr a zip code, you can try 54466

Sign in to reply to this post

president310264

Bump

ANyone had a chance to look at this?

Sign in to reply to this post

Jimmy Wu

It looks like the post value for that form element isn't being posted or the trigger for the search server behavior isn't being triggered. What is the trigger that you set for the search?

Sign in to reply to this post

president310264

The action for my search page points to a results page...

action="results.php"

Here is the code for my results page (please be patient as I am not a php guy...I am a CFer)

<?php require_once('Connections/wenzelscustomers.php'); ?>
<?php
//WA Database Search Include
require_once("WADbSearch/HelperPHP.php");
?>
<?php
//WA Database Search (Copyright 2005, WebAssist.com)
//Recordset: rsCustomers;
//Searchpage: customersearch.php;
//Form: customersearch;
$WADbSearch1_DefaultWhere = "0=0";
if (!session_id()) session_start();
if ((isset($_POST["WADbSearch1"])) && ($_POST["WADbSearch1"] != "")) {
$WADbSearch1 = new FilterDef;
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
//keyword array declarations
$KeyArr1 = array("ZIP");

//comparison list additions
$WADbSearch1->keywordComparison($KeyArr1,"".((isset($_POST["zip"]))?$_POST["zip"]:"") ."","AND","=",",%20","%20","%22","%22",0);

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

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

$maxRows_rsCustomers = 15;
$pageNum_rsCustomers = 0;
if (isset($_GET['pageNum_rsCustomers'])) {
$pageNum_rsCustomers = $_GET['pageNum_rsCustomers'];
}
$startRow_rsCustomers = $pageNum_rsCustomers * $maxRows_rsCustomers;

mysql_select_db($database_wenzelscustomers, $wenzelscustomers);
$query_rsCustomers = "SELECT * FROM CUSTOMERS";
setQueryBuilderSource($query_rsCustomers,$WADbSearch1,false);
$query_limit_rsCustomers = sprintf("%s LIMIT %d, %d", $query_rsCustomers, $startRow_rsCustomers, $maxRows_rsCustomers);
$rsCustomers = mysql_query($query_limit_rsCustomers, $wenzelscustomers) or die(mysql_error());
$row_rsCustomers = mysql_fetch_assoc($rsCustomers);

if (isset($_GET['totalRows_rsCustomers'])) {
$totalRows_rsCustomers = $_GET['totalRows_rsCustomers'];
} else {
$all_rsCustomers = mysql_query($query_rsCustomers);
$totalRows_rsCustomers = mysql_num_rows($all_rsCustomers);
}
$totalPages_rsCustomers = ceil($totalRows_rsCustomers/$maxRows_rsCustomers)-1;
?>
<?php
// RepeatSelectionCounter_1 Initialization
$RepeatSelectionCounter_1 = 0;
$RepeatSelectionCounterBasedLooping_1 = false;
$RepeatSelectionCounter_1_Iterations = "3";
?>

Sign in to reply to this post

Jimmy Wu

Sorry about that, I was thinking of another behavior. If you try going to the bindings panel and dragging the zip binding to somewhere to display on the page, you can check if the zip is being set correctly when you use enter to submit the form.

Sign in to reply to this post

president310264

I do not understand what you mean by zip binding? Can you walk me through it please?

Sign in to reply to this post

Jimmy Wu

So you should open up your page and go to the bindings panel (if its not open go to the Window menu and open it). There should be an entry under one of the dropdowns for zip. You would want to click and hold that item and drag it to somewhere on the page so that it gets displayed on the page.

Sign in to reply to this post

president310264

I see what you mean. Sorry I was spacing out there. I did that and when it breaks the zip in the recordset is empty. It is like it does not return anything from the form submission.

Sign in to reply to this post
loading

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