Calendar/dropdown for given set of dates/time

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Darla
Forum Newbie
Posts: 16
Joined: Mon Feb 12, 2007 8:27 am

Calendar/dropdown for given set of dates/time

Post by Darla »

Hello

I have a database with some records, these records have been inserted with a datetime (ex:20070214202701 ). I wish that the user can search for records for a given time or hour for all dates/hours that are in the table. Even for times where there are no records in the table, so it should be possible for the user to search for all hours/dates from the first entry to todays date. Are there some good calendars where this can be done, or does someone have some other example with for instance dropdowns using php?

Darla
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

You can use regex in mysql queries:

Code: Select all

SELECT * FROM `table` WHERE `datetime` REGEXP '^\d{8}20\d{4}$'
To search for all dates/times that are in the 8pm hour.
Darla
Forum Newbie
Posts: 16
Joined: Mon Feb 12, 2007 8:27 am

Post by Darla »

Ok cool, do you know any simple calendar scripts which you can configure to display the given startdate and up to todays date?
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

No, sorry.
Post Reply