just me and php Posted December 18, 2006 Share Posted December 18, 2006 Hi I Have A Colum In Datebase That Is date And I Would Like To Only Print/Echo A Weeks Worth Of Data.The date Colum format is 12/17/06 22:46:16. ( Echo 12/10/06 23:59:59 to 12/17/06 23:59:59 )Can Somebody Help Me With This Code .Thanks Link to comment https://forums.phpfreaks.com/topic/31095-how-can-i-print-echo-data-between-dates-only/ Share on other sites More sharing options...
just me and php Posted December 18, 2006 Author Share Posted December 18, 2006 Ok I Found This In Your Forums And I Think Its What Im Looking For But I Dont Under Stand How It Knows What Is The Start Or End Date.[url=http://www.phpfreaks.com/forums/index.php/topic,106961.0.html]http://www.phpfreaks.com/forums/index.php/topic,106961.0.html[/url] Link to comment https://forums.phpfreaks.com/topic/31095-how-can-i-print-echo-data-between-dates-only/#findComment-143571 Share on other sites More sharing options...
craygo Posted December 18, 2006 Share Posted December 18, 2006 just set it in the sql[code]$sql = "SELECT * FROM table rec_date BETWEEN DATE '2006-02-01' AND DATE '2006-02-14'";[/code]Ray Link to comment https://forums.phpfreaks.com/topic/31095-how-can-i-print-echo-data-between-dates-only/#findComment-143572 Share on other sites More sharing options...
just me and php Posted December 18, 2006 Author Share Posted December 18, 2006 Thanks Ray That Looks To Easy lol , Il Give It A Try Thanks Again.Ray <--Also Link to comment https://forums.phpfreaks.com/topic/31095-how-can-i-print-echo-data-between-dates-only/#findComment-143580 Share on other sites More sharing options...
just me and php Posted December 18, 2006 Author Share Posted December 18, 2006 Well I Tryed A Few Different Way Bet Get Error, How Can I Use This In My Code?[code]$query = "SELECT * FROM NatHotLap BETWEEN date '12/10/06 22:46:16' AND date '12/17/06 22:46:16'";=================And I Tryed This Way$query = "SELECT recno,disp,track,Username,date,online,hacked, MIN(HL_MS) AS HL_MS,reshack FROM NatHotLap BETWEEN date '12/10/06 22:46:16' AND date '12/17/06 22:46:16' ORDER BY 'HL_MS' ASC ";=================This Is My Code$p_id = $_GET['id'];$query = "SELECT recno,disp,track,Username,date,online,hacked, MIN(HL_MS) AS HL_MS,reshack FROM NatHotLap WHERE track = '$p_id' GROUP BY 'disp','online','Username','track' ORDER BY 'HL_MS' ASC ";[/code] Link to comment https://forums.phpfreaks.com/topic/31095-how-can-i-print-echo-data-between-dates-only/#findComment-143602 Share on other sites More sharing options...
craygo Posted December 18, 2006 Share Posted December 18, 2006 Date are stored in mysql as YYYY-MM-DD you cannot use YYYY/MM/DD use is exactly as I gave it. You do not need the time either. It will just go right by it.Ray Link to comment https://forums.phpfreaks.com/topic/31095-how-can-i-print-echo-data-between-dates-only/#findComment-143627 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.