mysql query paging

You need to use get_posts(), have_posts(), and the_post() for the API functions to work.