On Fri, 2004-02-27 at 22:43, Michal Migurski wrote:
> >The field is join_date_time and the values are something like:
> >20040222000015
> >20040223015329
> >
> >Everything is working fine and dandy except now that the client wants a
> >search functionality in his "control panel" where he can enter the day,
> >month, year and see all the people who have joined on that particular
> >date...
> >
> >I have created 3 text boxes in the html form named mm,dd,yyyy....but how
> >do i search on that?
> 
> All you need is substr() and the mysql keyword 'like', and you should be
> all set. Why didn't you make join_date_time a datetime in the first place?

There's several MySQL functions for retrieving aspects of the date. Look
into YEAR(), MONTH(), and DAYOFMONTH().

For more information:

http://www.mysql.com/documentation/mysql/bychapter/manual_Functions.html#Date_and_time_functions

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to