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

Multiple errors as a result of Search Wizard code.

Thread began 7/26/2010 1:23 pm by sandy259886 | Last modified 7/27/2010 11:07 am by Jason Byrnes | 499 views | 1 replies |

sandy259886

Multiple errors as a result of Search Wizard code.

I've tried several times to build this search. I'm cleared out the cache ... removed and reinstalled the extension. Still getting this problem. I'm now too frustrated to go any further.

--------------------------------------------------

The error(s):
Notice: Undefined variable: rsOrders in /home/sandyrumsey/public_html/ssl/_admin_pfg_10/orders_Srch/index.php on line 102

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/sandyrumsey/public_html/ssl/_admin_pfg_10/orders_Srch/index.php on line 102

Notice: Undefined variable: WADbSearch1 in /home/sandyrumsey/public_html/ssl/_admin_pfg_10/orders_Srch/index.php on line 103

Notice: Trying to get property of non-object in /home/sandyrumsey/public_html/WADbSearch/HelperPHP.php on line 381

Notice: Trying to get property of non-object in /home/sandyrumsey/public_html/WADbSearch/HelperPHP.php on line 395
--------------------------------------------------------------------------------------

My page sql code:

<?php require_once('../../../Connections/traders.php'); ?>
<?php require_once( "../../../WA_SecurityAssist/Helper_PHP.php" ); ?>
<?php
//WA Database Search Include
require_once("../../../WADbSearch/HelperPHP.php");
?>
<?php
if (!WA_Auth_RulePasses("Logged in to users")){
WA_Auth_RestrictAccess("../users_EmailPW.php");
}
?>
<?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;
}
}

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;
}
}

$currentPage = $_SERVER["PHP_SELF"];

mysql_select_db($database_traders, $traders);
$query_coupon = "SELECT * FROM coupons ORDER BY couponNum ASC";
$coupon = mysql_query($query_coupon, $traders) or die(mysql_error());
$row_coupon = mysql_fetch_assoc($coupon);
$totalRows_coupon = mysql_num_rows($coupon);

mysql_select_db($database_traders, $traders);
$query_affiliate = "SELECT * FROM affiliates ORDER BY AffiliateLink ASC";
$affiliate = mysql_query($query_affiliate, $traders) or die(mysql_error());
$row_affiliate = mysql_fetch_assoc($affiliate);
$totalRows_affiliate = mysql_num_rows($affiliate);

$maxRows_rsOrders = 45;
$pageNum_rsOrders = 0;
if (isset($_GET['pageNum_rsOrders'])) {
$pageNum_rsOrders = $_GET['pageNum_rsOrders'];
}
$startRow_rsOrders = $pageNum_rsOrders * $maxRows_rsOrders;

mysql_select_db($database_traders, $traders);
$query_rsOrders = "SELECT * FROM customers, orders, orderdetail WHERE customers.custID = orders.CustomerID AND orderdetail.orderID = orders.OrderId ORDER BY orders.OrderId DESC";
setQueryBuilderSource($query_rsOrders,$WADbSearch1,false);
$query_limit_rsOrders = sprintf("%s LIMIT %d, %d", $query_rsOrders, $startRow_rsOrders, $maxRows_rsOrders);
$rsOrders = mysql_query($query_limit_rsOrders, $traders) or die(mysql_error());
$row_rsOrders = mysql_fetch_assoc($rsOrders);

if (isset($_GET['totalRows_rsOrders'])) {
$totalRows_rsOrders = $_GET['totalRows_rsOrders'];
} else {
$all_rsOrders = mysql_query($query_rsOrders);
$totalRows_rsOrders = mysql_num_rows($all_rsOrders);
}
$totalPages_rsOrders = ceil($totalRows_rsOrders/$maxRows_rsOrders)-1;

$colname_rsaffiliateSession = "-1";
if (isset($_SESSION['affiliate'])) {
$colname_rsaffiliateSession = (get_magic_quotes_gpc()) ? $_SESSION['affiliate'] : addslashes($_SESSION['affiliate']);
}
mysql_select_db($database_traders, $traders);
$query_rsaffiliateSession = sprintf("SELECT * FROM affiliates WHERE AffiliateID = %s", GetSQLValueString($colname_rsaffiliateSession, "int"));
$rsaffiliateSession = mysql_query($query_rsaffiliateSession, $traders) or die(mysql_error());
$row_rsaffiliateSession = mysql_fetch_assoc($rsaffiliateSession);
$totalRows_rsaffiliateSession = mysql_num_rows($rsaffiliateSession);

$queryString_rsOrders = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_rsOrders") == false &&
stristr($param, "totalRows_rsOrders") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_rsOrders = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_rsOrders = sprintf("&totalRows_rsOrders=%d%s", $totalRows_rsOrders, $queryString_rsOrders);
?>
<?php
//WA Database Search (Copyright 2005, WebAssist.com)
//Recordset: rsOrders;
//Searchpage: index.php;
//Form: srchForm;
$WADbSearch1_DefaultWhere = "";
if (!session_id()) session_start();
if ((isset($_POST["WADbSearch1"])) && ($_POST["WADbSearch1"] != "")) {
$WADbSearch1 = new FilterDef;
$WADbSearch1->initializeQueryBuilder("MYSQL","1");
//keyword array declarations

//comparison list additions
$WADbSearch1->addComparisonFromEdit("Date","startDate","AND",">=",2);
$WADbSearch1->addComparison("Date","".WAQB_getEndDate($_POST["endDate"]) ."","AND","<=",2);

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

Sign in to reply to this post

Jason ByrnesWebAssist

can you compress the original php file into a zip archive and attach that to your reply so I can see the code in context.

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