Adobe Dreamweaver Forums



Last 10 THreads :         ANN: Contact Form Solution Pack (Last Post : Joseph Lowery - Replies : 0 - Views : 1 )           »          DW help urgently needed, lost my connection to site (Last Post : Murray *ACE* - Replies : 6 - Views : 7 )           »          Window Menu (Last Post : c-bread24 - Replies : 2 - Views : 3 )           »          Favicon for context-sensitive Help (WebHelp) (Last Post : Peter Grainge - Replies : 4 - Views : 5 )           »          Flash Advent Calendar (Last Post : JohnoMark - Replies : 2 - Views : 3 )           »          How can I create an executable with Flex Builder 3? (Last Post : awH$R - Replies : 2 - Views : 3 )           »          Advanced datagrid using Remote Objects (Last Post : Amy Blankenship - Replies : 3 - Views : 4 )           »          A question about using get and set methods (Last Post : Amy Blankenship - Replies : 1 - Views : 2 )           »          flex version (Last Post : thephantom6969 - Replies : 2 - Views : 3 )           »          Custom Scrollbar in Dreamweaver (Last Post : Tatious - Replies : 0 - Views : 1 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Dreamweaver: Main > Dreamweaver Application Development
 
Tags:



Reply
  #1 (permalink)  
Old 10-01-2008, 01:49 PM
speytay
 
Posts: n/a
Diggs:
Default Recordset pages show up blank

When my recordset is returned, the first page shows up perfectly. If I have,
for example, 22 records, they will all show up on that page. But, if I restrict
each page to 10 records, the first page shows up with 10 records, but the
second and third page will be blank. And when I navigate back to the first
page, it too is now blank.

There are multiple dynamic elements in a single cell, but this is working fine
( at least on the first page ).

The Navigation Bar works fine and the Navigation Status also works fine ( for
example, Page 2 will show "Records 11 - 20 of 22" ), but the page is blank.
What is going on here!

I am using MySQL, Apache, PHP, DWCS3 and Windows Vista.


<?php require_once('Connections/connB.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "",
$theNotDefinedValue = "")
{
$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"];

$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;

$varstate_Recordset1 = "1";
if (isset($_POST['state'])) {
$varstate_Recordset1 = $_POST['state'];
}
$varbusinessName_Recordset1 = "1";
if (isset($_POST['businessName'])) {
$varbusinessName_Recordset1 = $_POST['businessName'];
}
$varcity_Recordset1 = "1";
if (isset($_POST['city'])) {
$varcity_Recordset1 = $_POST['city'];
}
$varcategory_Recordset1 = "1";
if (isset($_POST['category'])) {
$varcategory_Recordset1 = $_POST['category'];
}
mysql_select_db($database_connB, $connB);
$query_Recordset1 = sprintf("SELECT states.state, categories.category,
cities.city, customers.businessName, customers.website, customers.email,
images.image, images.printedBy FROM states, categories, cities, customers,
images WHERE %s = states.state AND states.stateID = customers.stateID AND %s =
cities.city AND cities.cityID = customers.cityID AND %s = categories.category
AND categories.categoryID = images.categoryID AND images.customerID =
customers.customerID OR %s LIKE customers.businessName AND customers.cityID =
cities.cityID AND customers.stateID = states.stateID AND customers.customerID =
images.customerID AND images.categoryID = categories.categoryID",
GetSQLValueString($varstate_Recordset1,
"text"),GetSQLValueString($varcity_Recordset1,
"text"),GetSQLValueString($varcategory_Records et1,
"text"),GetSQLValueString($varbusinessName_Records et1, "text"));
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1,
$startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $connB) or
die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);

if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;

$queryString_Recordset1 = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_Recordset1") == false &&
stristr($param, "totalRows_Recordset1") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s",
$totalRows_Recordset1, $queryString_Recordset1);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<div id="mainContent">
<h2> Search Results:</h2>
<p>&nbsp;</p>
<table width="641" height="184" border="1">
<tr>
<td width="345">Company Information</td>
<td width="280">Business</td>
</tr>
<?php do { ?>
<tr>
<td height="156"><span class="style3"></span>
<p class="style9"><?php echo $row_Recordset1['category']; ?></p>
<p class="style9"><?php echo $row_Recordset1['businessName']; ?>
<span class="fltrt style4"><?php echo $row_Recordset1['website']; ?></span></p>
<p><span class="style4"><?php echo $row_Recordset1['city'];
?></span>, <span class="style4"><?php echo $row_Recordset1['state']; ?>
</span><span class="fltrt style4"><?php echo $row_Recordset1['email'];
?></span></p>
<p class="style4">
<p class="style4">&nbsp;</p></td>
<td><img src="images/<?php echo $row_Recordset1['image']; ?>"
name="rs1image" id="rs1image" />
<p class="style4"><span class="fltrt"><?php echo
$row_Recordset1['printedBy']; ?></span></p></td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
<p class="style4"><?php echo $row_Recordset1['image']; ?></p>
<p>&nbsp;</p>
<p>&nbsp;

<table border="0">
<tr>
<td><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage,
0, $queryString_Recordset1); ?>"><img src="images/First.gif" border="0" /></a>
<?php } // Show if not first page ?>
</td>
<td><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage,
max(0, $pageNum_Recordset1 - 1), $queryString_Recordset1); ?>"><img
src="images/Previous.gif" border="0" /></a>
<?php } // Show if not first page ?>
</td>
<td><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show
if not last page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage,
min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1);
?>"><img src="images/Next.gif" border="0" /></a>
<?php } // Show if not last page ?>
</td>
<td><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show
if not last page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage,
$totalPages_Recordset1, $queryString_Recordset1); ?>"><img
src="images/Last.gif" border="0" /></a>
<?php } // Show if not last page ?>
</td>
</tr>
</table>
</p>
<p>&nbsp;
Business <?php echo ($startRow_Recordset1 + 1) ?> - <?php echo
min($startRow_Recordset1 + $maxRows_Recordset1, $totalRows_Recordset1) ?> of
<?php echo $totalRows_Recordset1 ?> </p>

<!-- end #mainContent --></div>
<!-- This clearing element should immediately follow the #mainContent div in
order to force the #container div to contain all child floats --><br
class="clearfloat" />
<div id="footer">
<p>Footer</p>
<!-- end #footer --></div>
<!-- end #container --></div>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-01-2008, 01:49 PM
speytay
 
Posts: n/a
Diggs:
Default Re: Recordset pages show up blank

I found the answer to my question at http://friendsofed.infopop.net/
The quick answer is to change the Form Method and the Recordset Vaiables from "POST" to "GET".
Reply With Quote
  #3 (permalink)  
Old 10-01-2008, 01:49 PM
speytay
 
Posts: n/a
Diggs:
Default Re: Recordset pages show up blank

I found the answer to my question at http://friendsofed.infopop.net/
The quick answer is to change the Form Method and the Recordset Vaiables from "POST" to "GET".
Reply With Quote


Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 05:13 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk