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

Undefined variable: totalRows_ error

Thread began 4/26/2010 1:43 pm by Joe Lowery | Last modified 4/26/2010 5:15 pm by Jason Byrnes | 645 views | 3 replies |

Joe Lowery

Undefined variable: totalRows_ error

I used DataAssist to add a new set of management pages to my PowerStore site. When I run the results page, I get the following error:

Notice: Undefined variable: totalRows_WADAevents in C:\inetpub\wwwroot\Ellen Celli Jewelry\Admin\events.php on line 63

No records are displayed, even though there is definitely one in the database.

Here's the code for the first part of my page (line 63 is the last line of code before the closing php tag):

<?php require_once( "../WA_Globals/WA_Globals.php" ); ?>
<?php require_once('../Connections/localhost.php'); ?>
<?php require_once("../WA_DataAssist/WA_AppBuilder_PHP.php"); ?>
<?php require_once("../WA_ValidationToolkit/WAVT_Scripts_PHP.php"); ?>
<?php require_once("../WA_ValidationToolkit/WAVT_ValidatedForm_PHP.php"); ?>
<?php require_once( "../WA_SecurityAssist/Helper_PHP.php" ); ?>
<?php require_once( "../WADbSearch/HelperPHP.php" ); ?>
<?php
if (!WA_Auth_RulePasses("Administrator")){
WA_Auth_RestrictAccess("index.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;
}
}
?>
<?php
$currentPage = $_SERVER["PHP_SELF"];
?>
<?php
$queryString_WADAevents = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_WADAevents") == false &&
stristr($param, "totalRows_WADAevents") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_WADAevents = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_WADAevents = sprintf("&totalRows_WADAevents=%d%s", $totalRows_WADAevents, $queryString_WADAevents);
?>



Any ideas what could be wrong?

Best - Joe

Sign in to reply to this post

Jason ByrnesWebAssist

Hi Joe, the probelm is code order.

The Recordset code that defines $totalRows_WADAevents is after this block of code that is using it:


<?php
$queryString_WADAevents = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_WADAevents") == false &&
stristr($param, "totalRows_WADAevents") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_WADAevents = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_WADAevents = sprintf("&totalRows_WADAevents=%d%s", $totalRows_WADAevents, $queryString_WADAevents);
?>



move the WADAevents code before this code so the $totalRows_WADAevents variable will created before it is being used.

Sign in to reply to this post

Joe Lowery

Thanks, Jason - that did it!

Sign in to reply to this post

Jason ByrnesWebAssist

No worries Joe, glad to hear it worked.

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