Page 1 of 1

Hide and show field

Posted: Thu May 07, 2009 11:28 pm
by rei27
Hi everyone, i wish to create a mail box like outlook, group together the mail according the date. When i click the date just show the mail on that day. I dun want all the data just simply show. It will look messy. Hope can get the respond soon. Thanks a lot!

Re: Hide and show field

Posted: Thu May 07, 2009 11:40 pm
by John Cartwright
How are you storing the emails? Mysql database?

Re: Hide and show field

Posted: Thu May 07, 2009 11:41 pm
by rei27
ya...

i have a table to store the mail, but when i wan to read, all of them show out! So i wish to hide them according to date. When click it just show

Re: Hide and show field

Posted: Thu May 07, 2009 11:50 pm
by John Cartwright
Assuming you have used a datetime field to store when the row (email) was inserted into the table, you can use a query similiar to

Code: Select all

SELECT * FROM `emails` WHERE DATE(`created`) = CURRENT_DATE()
I'm sure there is a more efficient way, but it's a bit late and I'm off to sleep :)

Re: Hide and show field

Posted: Fri May 08, 2009 12:40 am
by rei27
ok~ thanks :wink: