View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Price range search

Thread began 10/23/2009 12:37 pm by maurizio.melandri390100 | Last modified 10/28/2009 2:48 pm by maurizio.melandri390100 | 1863 views | 7 replies

maurizio.melandri390100

I tried again. I used both the wizard DataAssist and the wizard DataAssist search. The price range-finding fails, all other research work, but when it searches for a price range don't find any records.
this is the page of results.

<?php require_once('Connections/schede.php'); ?>
<?php
//WA Database Search Include
require_once("WADbSearch/HelperPHP.php");
?>
<?php
//WA Database Search (Copyright 2005, WebAssist.com)
//Recordset: WADAdhpc_prodotti;
//Searchpage: search.php;
//Form: WADASearchForm;
$WADbSearch1_DefaultWhere = "";
if (!session_id()) session_start();
if ((isset($_GET["Search_x"]) && $_GET["Search_x"] != "")) {
$WADbSearch1 = new FilterDef;
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
//keyword array declarations

//comparison list additions
$WADbSearch1->addComparisonFromList("DHPC_Descrizione_tipo","S_DHPC_Descrizione_tipo","AND","=",0);
$WADbSearch1->addComparisonFromEdit("dhpc_Sigla","S_dhpc_Sigla","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("dhpc_Prezzo","S_dhpc_Prezzo","AND","<=",1);
$WADbSearch1->addComparisonFromEdit("dhpc_Prezzo","S_dhpc_Prezzo","AND",">=",1);

//save the query in a session variable
if (1 == 1) {
$_SESSION["WADbSearch1_listaprodotticercati"]=$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_listaprodotticercati"]) && $_SESSION["WADbSearch1_listaprodotticercati"] != "") {
$WADbSearch1->whereClause = $_SESSION["WADbSearch1_listaprodotticercati"];
}
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;
}
}
?>
<?php
$currentPage = $_SERVER["PHP_SELF"];
?>
<?php
$maxRows_WADAdhpc_prodotti = 5;
$pageNum_WADAdhpc_prodotti = 0;
if (isset($_GET['pageNum_WADAdhpc_prodotti'])) {
$pageNum_WADAdhpc_prodotti = $_GET['pageNum_WADAdhpc_prodotti'];
}
$startRow_WADAdhpc_prodotti = $pageNum_WADAdhpc_prodotti * $maxRows_WADAdhpc_prodotti;

$WADADHPC_Descrizione_tipo_WADAdhpc_prodotti = "-1";
if (isset($_GET['DHPC_Descrizione_tipo'])) {
$WADADHPC_Descrizione_tipo_WADAdhpc_prodotti = (get_magic_quotes_gpc()) ? $_GET['DHPC_Descrizione_tipo'] : addslashes($_GET['DHPC_Descrizione_tipo']);
}
mysql_select_db($database_schede, $schede);
$query_WADAdhpc_prodotti = sprintf("SELECT dhpc_tipo, dhpc_Marca, dhpc_Sigla, dhpc_Descrizione, dhpc_Descrizione_lunga, dhpc_Descrizione_negozio, dhpc_Prezzo, dhpc_Foto, DHPC_Descrizione_tipo FROM dhpc_prodotti ORDER BY dhpc_Marca ASC", GetSQLValueString($WADADHPC_Descrizione_tipo_WADAdhpc_prodotti, "text"));
setQueryBuilderSource($query_WADAdhpc_prodotti,$WADbSearch1,false);
$query_limit_WADAdhpc_prodotti = sprintf("%s LIMIT %d, %d", $query_WADAdhpc_prodotti, $startRow_WADAdhpc_prodotti, $maxRows_WADAdhpc_prodotti);
$WADAdhpc_prodotti = mysql_query($query_limit_WADAdhpc_prodotti, $schede) or die(mysql_error());
$row_WADAdhpc_prodotti = mysql_fetch_assoc($WADAdhpc_prodotti);

if (isset($_GET['totalRows_WADAdhpc_prodotti'])) {
$totalRows_WADAdhpc_prodotti = $_GET['totalRows_WADAdhpc_prodotti'];
} else {
$all_WADAdhpc_prodotti = mysql_query($query_WADAdhpc_prodotti);
$totalRows_WADAdhpc_prodotti = mysql_num_rows($all_WADAdhpc_prodotti);
}
$totalPages_WADAdhpc_prodotti = ceil($totalRows_WADAdhpc_prodotti/$maxRows_WADAdhpc_prodotti)-1;
?>
<?php
$maxRows_WADADynListdhpc_prodotti = 1000;
$pageNum_WADADynListdhpc_prodotti = 0;
if (isset($_GET['pageNum_WADADynListdhpc_prodotti'])) {
$pageNum_WADADynListdhpc_prodotti = $_GET['pageNum_WADADynListdhpc_prodotti'];
}
$startRow_WADADynListdhpc_prodotti = $pageNum_WADADynListdhpc_prodotti * $maxRows_WADADynListdhpc_prodotti;

mysql_select_db($database_schede, $schede);
$query_WADADynListdhpc_prodotti = "SELECT DHPC_Descrizione_tipo, DHPC_Descrizione_tipo FROM dhpc_prodotti ORDER BY dhpc_Marca";
$query_limit_WADADynListdhpc_prodotti = sprintf("%s LIMIT %d, %d", $query_WADADynListdhpc_prodotti, $startRow_WADADynListdhpc_prodotti, $maxRows_WADADynListdhpc_prodotti);
$WADADynListdhpc_prodotti = mysql_query($query_limit_WADADynListdhpc_prodotti, $schede) or die(mysql_error());
$row_WADADynListdhpc_prodotti = mysql_fetch_assoc($WADADynListdhpc_prodotti);

if (isset($_GET['totalRows_WADADynListdhpc_prodotti'])) {
$totalRows_WADADynListdhpc_prodotti = $_GET['totalRows_WADADynListdhpc_prodotti'];
} else {
$all_WADADynListdhpc_prodotti = mysql_query($query_WADADynListdhpc_prodotti);
$totalRows_WADADynListdhpc_prodotti = mysql_num_rows($all_WADADynListdhpc_prodotti);
}
$totalPages_WADADynListdhpc_prodotti = ceil($totalRows_WADADynListdhpc_prodotti/$maxRows_WADADynListdhpc_prodotti)-1;
?>
<?php
$queryString_WADAdhpc_prodotti = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_WADAdhpc_prodotti") == false &&
stristr($param, "totalRows_WADAdhpc_prodotti") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_WADAdhpc_prodotti = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_WADAdhpc_prodotti = sprintf("&totalRows_WADAdhpc_prodotti=%d%s", $totalRows_WADAdhpc_prodotti, $queryString_WADAdhpc_prodotti);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

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