473,379 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Page number links are not appearing in MySQL paginated result set

Ajm113
161 100+
Ok, I am trying to get page numbering going here. Since I have two other strings going on the address bar I need to have it so if a user wanted to goto another page wont loss what he or she is looking for. So far the hole page=1 or etc works fine. Its just the links that I am trying to get to work are messing up on me!

[PHP]//List page numbers


$numOfPages = ceil($rowCount->Total / $perPage);

print" <a href='search.php$search$type&page=1'><< First Page</a>";

if(($pageNumber - $Padding) > 1)
{
$lowerLimit = $pageNumber = $Padding;
for($i = $lowerLimit; $i < $pageNumber; $i++)
{
print "<a href='search.php?orgin=$type&search=$search&page=$ i'>$i</a>";
}
print" <a href='search.php?orgin=$type&search=$search&page=$ numOfPages'>Last Page>></a></center>";
}[/PHP]


For some reason the area where it shows the page numbers is not showing. Even the last page link is not showing aether and also the Goto first page link is not going to the first page correctly!
Jun 22 '07 #1
3 1602
pbmods
5,821 Expert 4TB
Changed thread title to better describe the problem (did you know that threads whose titles contain phrases such as 'I need help' actually get FEWER responses?).
Jun 22 '07 #2
code green
1,726 Expert 1GB
The following syntax is wrong
Expand|Select|Wrap|Line Numbers
  1. print" <a href='search.php$search$type&page=1'><< First Page</a>";
I'm guessing it should be
Expand|Select|Wrap|Line Numbers
  1. print" <a href='search.php?search=$type&page=1'> << First Page</a>"
I would tidy up your quotes. HTML prefers double quotes and php is much faster using single quotes. So wrap strings in single quotes using double quotes inside. When using a php function or variable close the single quote and concatenate with the full stop/period either side and open single quote again. This is parsed much faster.
The double chevron will also confuse some browsers
Expand|Select|Wrap|Line Numbers
  1. << First Page
For some reason the area where it shows the page numbers is not showing
I can't see where you are showing the page numbers.
Jun 22 '07 #3
pbmods
5,821 Expert 4TB
HTML prefers double quotes and php is much faster using single quotes. So wrap strings in single quotes using double quotes inside. When using a php function or variable close the single quote and concatenate with the full stop/period either side and open single quote again. This is parsed much faster.
To expand on this point, PHP parses double-quoted strings for variables and some expressions, but it will not bother if the string is single-quoted. As a general rule, you should avoid using double quotes unless you are including a variable or expression in the string.

For more information, check out this page.
Jun 22 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: hilz | last post by:
Hi all: Is there a way to make the <fo:page-number> start from a value different than 1 ? (using fop to generate pdf) thanks hilz
1
by: Michel | last post by:
Hi all, This is my first post, so I am very new at this. I am trying to use page-number-citation twice in my code, but the second time it just shows '0'. The output is in pdf format and I am...
0
by: RJN | last post by:
Hi I have a datagrid which is put inside a div tag to make it scrollable. I need to page the datagrid. The page numbers appear at the bottom of the datagrid and has to be scrolled down...
3
by: tldisbro | last post by:
Hello All, I am trying to use the returned value of the <fo:page-number> element/function in my <xsl:if> test condition. But am unsuccessful in doing so. Is it possible to use it in this fashion...
0
by: Jean-François Michaud | last post by:
Hello all, I need to generate (SHEET X of Y) in titles for figures contained in a section (I already generate page A of B at the bottom right of every page in the document). Is there a way...
1
by: thirunavukarasukm | last post by:
I have a link wich opens a the second page with links wich call a javascript function. I have some problem with javascript. i am two aspx page.. in my first aspx page contain the second...
8
by: printline | last post by:
Hello I have a problem which i hope someone can help me with. I have a website where customers can login and their current and previous orders. What i need now is for the customers to look...
2
by: tburger | last post by:
Hey Everyone - I'm working on a greasemonkey script and I'm having some trouble... What I would like to do is to scan a page for links, store them, and then open them - one at a time - in a new...
1
by: bandy | last post by:
Hi there, I am quite confusing in getting page number for pagination links. See what I am doing:I have a ShowDetails.php page on which I have created page links in for loop. Onclick of every...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.