Jump to content


Photo

pagination problem


  • Please log in to reply
2 replies to this topic

#1 pottidmeat

pottidmeat
  • Members
  • Pip
  • Newbie
  • 1 posts

Posted 28 September 2006 - 07:56 PM

Hi,

I hope someone can help me resolve this issue, as it's driving me crazy.

Here are the respective links just in case it might help to get a clearer picture:

http://www.gmparchit...t=Water Terrace

http://www.atomicche...t=Water Terrace

Here's the skinny...

The "project.php" page on each respective server is identical, line for line.  The problem is that the pagination aspect on the test server (www.atomiccherry.com/) works great, but on the clients server, the one it needs to work on, doesn't function properly.

Here's a snippet of the code:

<?php

if ($totalRows > 1) {
do {
echo "<div class='center'><img src='../images/projects/" . $row['image'] . "' /></div>";
} while ($row = mysql_fetch_array($result));

echo "<div style='text-align: right; font-size: 10px; margin-top: 15px; height: 25px; padding-top: 4px;'>";
if ($page != 1) {
$pageprev = $page - 1;
echo "<a href='projects.php?page=$pageprev&project=" . $_GET['project'] . "'>&lt;&lt; </a>";
} else {

}

$numofpages = $totalRows / $limit;

for ($i = 1; $i <= $numofpages; $i++) {
if ($i == $page && $totalRows > 1) {
echo "<span style='color: #DDDCDB;'> " . $i . " </span>";
} elseif ($totalRows > 1) {
echo "<a href='projects.php?page=$i&project=". $_GET['project'] . "'>$i</a> ";
}
}

if (($totalRows % $limit) != 0) {
if ($i == $page && $totalRows > 1) {
echo "<span style='color: #DDDCDB;'> " . $i . " </span>";
} elseif ($totalRows > 1) {
echo "<a href='projects.php?page=$i&project=" . $_GET['project'] . "'>$i</a> ";

}
}

if (($totalRows - ($limit * $page)) > 0) {
$pagenext = $page + 1;
echo "<a href='projects.php?page=$pagenext&project=" . $_GET['project'] . "'>&gt;&gt;</a>";
} else {
}
echo "</div>";

} // end recordset finds results query

if ($totolRows == 1) {
echo "<div><img src='../images/projects/" . $row['image'] . "' /></div>";
}

?>  

#2 HuggieBear

HuggieBear
  • Members
  • PipPipPip
  • Advanced Member
  • 1,899 posts
  • LocationEngland, UK

Posted 28 September 2006 - 09:13 PM

What exactly isn't functioning, they both appear to be working the same as far as I can see.

Pagination looks good on both.

Regards
Huggie
Advice to MySQL users: Get phpMyAdmin and test your queries work there first, take half the hassle out of diagnosis, also check the reserved words list.

Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools

#3 mendoz

mendoz
  • Members
  • PipPipPip
  • Advanced Member
  • 118 posts

Posted 28 September 2006 - 09:27 PM

Both are working fine man




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users