Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 26th, 2004, 11:34 AM
Authorized User
 
Join Date: Oct 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Result Pagination not directly from database


Hey guys...

I need some help here. I have a database of employee's unavailability with fields of start and end dates (both in format of YYYY/MM/DD) of unavailability of the employee.

I have no problem using result pagination directly from database so far since at this moment all the records in the database are the records of the current year. The problem came across in my mind about what will happen in the future when the records getting bigger and bigger and bigger. It will take forever if my script has to go through all those records.

So, what I have in my mind is, to go through all the records once, select ONLY current year's records and save them on some kind of array. From there, I hope I can do anything with the selected records. However, I cannot use them when I try to display the selected records using pagination.

My questions are:
- does the pagination-result code only work with result which directly taken from sql queries?
- what are possible solutions of my problem without i have to modify my database?

Thanks in advanced and any help are welcome... :D



« Wayang Mßeling »
÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷ ÷÷÷÷÷
ASP Newbie needs guidances here
__________________
« Wayang Mßeling »
÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷ ÷÷÷÷÷
ASP/PHP Prog. Wannabe needs guidances here
 
Old June 3rd, 2004, 01:35 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Admitedly I've not much experience with MySQL timestamps, I've always chosen to handle that with PHP. But something like this might work:

mysql_query("SELECT FROM table WHERE YEAR(time_stamp_field) >= ".date('Y'));

http://dev.mysql.com/doc/mysql/en/Da...functions.html

Regards,
Rich

::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::
 
Old June 9th, 2004, 01:35 PM
Authorized User
 
Join Date: Oct 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey Rich...

thanks for the reply...i'll take a look at the link...it looks like that is the one I need... i will let you know the result thanks once again... :D

« Wayang Mßeling »
÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷ ÷÷÷÷÷
ASP/PHP Prog. Wannabe needs guidances here





Similar Threads
Thread Thread Starter Forum Replies Last Post
GridView and SQL More than one result = one result DarkForce ASP.NET 2.0 Basics 0 July 20th, 2007 04:29 AM
Database unable to show result. (ASP.NET C#) richie86 ASP.NET 1.0 and 1.1 Basics 3 November 10th, 2005 01:59 PM
Random Result from Database Ravenwillow Beginning VB 6 2 June 27th, 2005 02:46 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.