Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

RE: [PHP-DB] how to implement "pages" of results
Off the top of my head, doesn't LIMIT accept two paramters?

Can't you do:

LIMIT 30,2

That'd give you page 2 of a 30+ record result set, right?


Using that, you can pass a page # when you click "next page" so previous
page ends up being current page - 1 (and "if that is less than 1, then
it equals 1... And if it's > recordcount / 30 + 1, then it equals
recordcount / 30 + 1)

Try working checking into that.

-TG

> -----Original Message-----
> From: ragan_davis@colstate.edu [mailto:ragan_davis@colstate.edu]=20
> Sent: Wednesday, November 24, 2004 3:20 PM
> To: php-db@lists.php.net
> Subject: [PHP-DB] how to implement "pages" of results
>=20
>=20
> Hi,
>=20
> I'm sure this is a common question, so please forgive if it's=20
> been posted before.
>=20
> I have a select statement that selects records from a table:
> "select * from $table where host=3D'$somename'"
>=20
> I then propagate a table with the returned data.  My goal is=20
> to only display 30 records per "page", with links on each=20
> page that take the user to the next and previous 30 records. =20
> I have played around with using "limit", but this seems to=20
> only get me the next 30.  How to achieve the previous 30?  It=20
> would be easy if the records returned were sequentially=20
> numbered...but, since I'm being selective in which records I=20
> return (host=3D$somename), this is not the case.  The first row=20
> may be 1, and the second row may be 10, etc.
>=20
> Anyone have any ideas on how to solve this?
>=20
> Thanks!
>=20
> --=20
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>=20
>=20

Report this thread to moderator Post Follow-up to this message
Old Post
Trevor Gryffyn
11-25-04 01:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP DB archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:48 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.