Print Page | Close Window

recordset paging in MySQL

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=675
Printed Date: 28 March 2026 at 9:01am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: recordset paging in MySQL
Posted By: clubsunshine
Subject: recordset paging in MySQL
Date Posted: 03 March 2003 at 4:27am

Hi.

I was wondering if I can page a recordset from a MySQL-db. I tried the way I learned to use with Access (i.e. with rst.PageSize, rst.RecordCount and rst.PageCount), but it didn't do me no good (b-t-w, cursortype was 'adOpenStatic').

Does MySQL support paging (or is this db-independent) and if so, can anyone provide me with a way to do so (perhaps s.th. along the lines of the 'LIMIT'-clause in the SQL statement?).

Thanks!



-------------
Things could well become funky. I'm just here to regulate funkyness. (The Mexican)



Replies:
Posted By: michael
Date Posted: 03 March 2003 at 9:51am

That's what I found:  (Do a search on google, there is a bunch)

To page using mySQL you have to use the LIMIT command like this

SELECT fields ...
FROM table
LIMIT $offset,$pgsize

store the page number you are on in your html form as a hidden field or a cookie or whatever you're comfortable with so that you can pass it back to your ASP in order to figure out the next $offset (i.e. $offset = ($pg-1) * $pgsize)




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net