Click here to get back home

How to make the result of query in small numbered links, which has next and previous

 HomeNewsGroups | Search

comp.lang.php - PHP programming language discussions 

get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
How to make the result of query in small numbered links, which has next and previous gafow 06-01-2008
Posted by gafow on June 1, 2008, 8:37 am
Please log in for more thread options
$results = mysql_query($query);
con_query($result);
while($pages = mysql_fetch_array($result)){
show/hide quoted text
}
}

$pages[1-300] -pages

to make links

show/hide quoted text

Thank you very much

Posted by Curtis on June 1, 2008, 9:17 am
Please log in for more thread options
gafow wrote:
show/hide quoted text

When I first started PHP, I had trouble on this issue, too, but only
because I didn't know it was called pagination, so it was a bit hard
for me to search for the topic.

Try googling: "php pagination" to see what you find.

--
Curtis

Posted by Jerry Stuckle on June 1, 2008, 9:24 am
Please log in for more thread options
gafow wrote:
show/hide quoted text

Figure out how many items you want per page. Now get a count of the
number of items which would be retrieved and divide by the number of
items per page. This will give you the number of pages (after
accounting for a possible partial page, of course).

For instance - if you want 10 items per page, the easiest way would be:

$numpages = intval(($itemcount + 9) / 10);

Now figure out what page you're on, and fetch the entries from the
database just for that page.

And if you need help with the SQL end, check comp.databases.mysql.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Similar ThreadsPosted
Help with Previous and Next links and Displaying Database information October 24, 2005, 6:52 pm
Search page result links July 6, 2006, 2:45 pm
make the links open in a new window.. March 11, 2005, 1:19 am
Double query form, result of 1st query drops anything after a space October 23, 2004, 4:27 pm
Assign the result of $db->query($query) to a variable ??? March 1, 2010, 11:06 am
Assign the result of $db->query($query) to a variable ??? March 1, 2010, 11:07 am
Lots of small queries vs one big query November 21, 2006, 7:09 pm
Can you use the result from one query as a criteria in a second query? September 20, 2004, 11:58 am
same mysql query doesn't always return a result September 9, 2005, 9:04 am
displaying the result of a COUNT query in MySQL December 19, 2005, 10:29 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Driving a better car - Fuelzilla.com

Cabling site for homeowners and pros alike - Cabling-Design.com

Friends:

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap
Privacy Policy