Hide and show field

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
rei27
Forum Commoner
Posts: 27
Joined: Thu Apr 30, 2009 4:17 am

Hide and show field

Post 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!
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Hide and show field

Post by John Cartwright »

How are you storing the emails? Mysql database?
rei27
Forum Commoner
Posts: 27
Joined: Thu Apr 30, 2009 4:17 am

Re: Hide and show field

Post 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
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Hide and show field

Post 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 :)
rei27
Forum Commoner
Posts: 27
Joined: Thu Apr 30, 2009 4:17 am

Re: Hide and show field

Post by rei27 »

ok~ thanks :wink:
Post Reply