close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Undefined Variable total pages / clear search

Thread began 10/09/2009 11:06 am by info271221 | Last modified 12/03/2009 5:44 pm by Jason Byrnes | 5846 views | 12 replies |

info271221

Undefined Variable total pages / clear search

I am getting the following error on the bottom of my page.

PHP Notice: Undefined variable: totalPages_WADAbear in D:\Websites\www.myDomain\RecordBear\Bear_Results.php on line 479 PHP Notice: Undefined variable: totalPages_WADAbear in D:\Websites\www.myDomain\RecordBear\Bear_Results.php on line 482 PHP Notice: Undefined variable: totalPages_WADAbear in D:\Websites\www.myDomain\RecordBear\Bear_Results.php on line 537 PHP Notice: Undefined variable: totalPages_WADAbear in D:\Websites\www.myDomain\RecordBear\Bear_Results.php on line 540

Bear_Results.php

Also - if you search something, then browse to another page and click on the link for the measurer again it holds the results for the last search. Is that normal or is their a way to clear the search when you leave the page?

Thanks!

Sign in to reply to this post

Jason ByrnesWebAssist

There is a chunk of code that has been removed from the results page.




if you look at the Bear_ResultsBACKUP.php page at line 144 - 158 the code for the WADAbear recordset looks like:

php:
mysql_select_db($database_wibuckbear, $wibuckbear);

$query_WADAbear = "SELECT * FROM bear ORDER BY BScore DESC";
setQueryBuilderSource($query_WADAbear,$WADbSearch1,false);
$query_limit_WADAbear = sprintf("%s LIMIT %d, %d", $query_WADAbear, $startRow_WADAbear, $maxRows_WADAbear);
$WADAbear = mysql_query($query_limit_WADAbear, $wibuckbear) or die(mysql_error());
$row_WADAbear = mysql_fetch_assoc($WADAbear);


if (isset($_GET['totalRows_WADAbear'])) {
  $totalRows_WADAbear = $_GET['totalRows_WADAbear'];
} else {
  $all_WADAbear = mysql_query($query_WADAbear);
  $totalRows_WADAbear = mysql_num_rows($all_WADAbear);
}
$totalPages_WADAbear = ceil($totalRows_WADAbear/$maxRows_WADAbear)-1;






on the Bear_Results.php page, the code for the recordset is at line 144 - 149:

php:
mysql_select_db($database_wibuckbear, $wibuckbear);

$query_WADAbear = "SELECT * FROM bear ORDER BY BScore DESC";
setQueryBuilderSource($query_WADAbear,$WADbSearch1,false);
$WADAbear = mysql_query($query_WADAbear, $wibuckbear) or die(mysql_error());
$row_WADAbear = mysql_fetch_assoc($WADAbear);
$totalRows_WADAbear = mysql_num_rows($WADAbear);







This section of code has been removed:

php:
if (isset($_GET['totalRows_WADAbear'])) {

  $totalRows_WADAbear = $_GET['totalRows_WADAbear'];
} else {
  $all_WADAbear = mysql_query($query_WADAbear);
  $totalRows_WADAbear = mysql_num_rows($all_WADAbear);
}
$totalPages_WADAbear = ceil($totalRows_WADAbear/$maxRows_WADAbear)-1;
Sign in to reply to this post

info271221

Undefined Index ID on results page

THANKS! Now I am down to1 error. I checked the deer page where this function is working and cannot figure out what is wrong.

PHP Notice: Undefined index:

Sign in to reply to this post

Jason ByrnesWebAssist

the if statement on line 130:
if ($_SESSION['id']) {


should be:
if (isset($_SESSION['id'])) {

Sign in to reply to this post

info271221

Search does not clear previous results

If a submit a search on the attached pages, and then submit another search with -0- fields selected the results are retained from my previous search. How do I get it to clear / reset so that it will not retain the previously searched items.

It appears to be working on the attached mydomain.org/member_measurer/member_directory_Results.php as it returns results from the beginning of the alphabet

On this page we are returning results ONLY IF a selection is made which works GREAT on the original search but if you search again and do not make any selections it will still return results
mydomain.org/member_measurer/member_directory_Search_measurer.php?reset=true

Thank You!!

Sign in to reply to this post

info271221

Manage Page Next, Last is not working correctly

On this page: Load_Manage.php?pageNum_WADAtbl_vehicle_info=1&totalRows_WADAtbl_vehicle_info=21 (Julie / Password) the Next / Last links are not working correctly.

They say 1-20 and pull up 20 (correctly) however then you click on the next or last link and are supposed to see 21-21; however you see all the same listing.

Sign in to reply to this post

Jason ByrnesWebAssist

on the search page for the member_directory_Results.php, set the form action to member_directory_Results.php?reset=true

Then add the following code just before the database search code at line 12

php:
<?php

if(!session_id()) session_start();
if(isset(
$_SESSION["WADbSearch1_member_directory_Results"]) && isset($_GET['reset']) && $_GET['reset'] == "true") {
  unset(
$_SESSION["WADbSearch1_member_directory_Results"]);
}
?>




I'll need you to send a copy of the Load_Manage.php page so I can examine the code.

Sign in to reply to this post

info271221

Measurer Results still does not reset

Files attached mysite.org/http://www.mysite.org/member_measurer/member_directory_Search_measurer.php?reset=true

Is the reset neccessary in the url?

Sign in to reply to this post

Jason ByrnesWebAssist

having reset=true in the URL is what are using to clear the previous results.


It should only be included in the URL when you want the previous search results to be cleared.

Sign in to reply to this post

info271221

Still not clearing

It is not clearing. Please review previously attached files.
You may test here:
member_directory_Search_measurer.php?reset=true

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