r00ttap Posted February 20, 2009 Share Posted February 20, 2009 Honestly this is more of a SQL question then PHP but I'm sure most people here have a good amount of knowledge on both. My problem is that I'm trying to make my code as efficient as possible by pulling only what I need from the database. I will try and draw this out so it will make some sense to you. My current database would be: +--------------+--------------+ | end_time | date +--------------+--------------+ | 15:30:00 | 2009-02-02 +--------------+--------------+ I need something posted UNTIL the end_time is up on that specific date. My query looks somethign like this: $campus_name = mysql_query("SELECT * FROM table WHERE campus = 'campus_name' AND date >= CURDATE() ORDER by date, time") or die(mysql_error()); Of course this will keep something posted until the date changes but I really need the text to disappear after the time is over. Is this something the SQL can't handle and that I may just have to narrow it down even more with PHP? Link to comment https://forums.phpfreaks.com/topic/146149-slimming-down-results-with-sql-query/ Share on other sites More sharing options...
r00ttap Posted February 20, 2009 Author Share Posted February 20, 2009 Sorry, didn't know there was an SQL help forum. This can be deleted. Link to comment https://forums.phpfreaks.com/topic/146149-slimming-down-results-with-sql-query/#findComment-767289 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.