TheFilmGod Posted September 11, 2007 Share Posted September 11, 2007 Hey, I was hoping someone can give me some ideas to create a php feature. I'm making a site for the school's student council. They want me to make a dynamic thing where there is a date and time of the next meeting on the homepage. I was hoping if anyone has a creative idea of doing this. PHP - wise. Should I make a table in mysql, with a row for each date and have php check the time and the next meeting to be shown? How would YOU, as a developer go around doing this? General idea and basic php method would be helpulf. Thanks! ;D Link to comment https://forums.phpfreaks.com/topic/68902-not-php-code-php-creative-ideas/ Share on other sites More sharing options...
liebs19 Posted September 11, 2007 Share Posted September 11, 2007 That would probably be the best idea. Just ORDER BY the date in your query, then cycle through them until you find one that has not already passed. Link to comment https://forums.phpfreaks.com/topic/68902-not-php-code-php-creative-ideas/#findComment-346312 Share on other sites More sharing options...
effigy Posted September 11, 2007 Share Posted September 11, 2007 SELECT fields FROM table WHERE meeting_date >= NOW() ORDER BY meeting_date LIMIT 1 Link to comment https://forums.phpfreaks.com/topic/68902-not-php-code-php-creative-ideas/#findComment-346315 Share on other sites More sharing options...
roopurt18 Posted September 11, 2007 Share Posted September 11, 2007 Should I make a table in mysql, with a row for each date and have php check the time and the next meeting to be shown? I'm not really sure how else you'd go about doing it. meetings id | datetime | name | description | notes SELECT datetime, name, description FROM meetings ORDER BY datetime DESC LIMIT 1 Then you just give them an admin page to add, edit, and delete entries. A general page to view all meetings that have occurred along with their notes would be helpful. I'm not really sure what you were looking for as an answer. Link to comment https://forums.phpfreaks.com/topic/68902-not-php-code-php-creative-ideas/#findComment-346317 Share on other sites More sharing options...
liebs19 Posted September 11, 2007 Share Posted September 11, 2007 Doh! Yeah, LIMIT 1 instead of doing it by a loop. Link to comment https://forums.phpfreaks.com/topic/68902-not-php-code-php-creative-ideas/#findComment-346318 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.