bbmak Posted January 21, 2008 Share Posted January 21, 2008 Hi, I am first time using flat database. I am trying to building a scheduler. I have finish with the insert part to the txt file. However, on the get data part, I am trying to show the events for today. here is how the data store in database.txt Day of Insert the event||Day of Perform||Time||User||User Email||Events 2008-Jan-15_05:06:08PM||2008-01-19||12-13||bbmak||[email protected]||test I want the scheduler only show today's tasks. May I know how do i sort that? Let say I want to show only 2008-01-20 data. Here is the code that i have so far <? $date = mktime(0, 0, 0, date("m"), date("d")+"$w", date("y")); $today = date("Y-m-d", $date); $Lines = file("database.txt"); foreach($Lines as $Key => $Val) { //explode that data into a new array: $Data[$Key] = explode("||", $Val); } for($K = 0; $K < sizeof($Lines); $K++) { echo '<p>'; echo 'Schedule ID: ' . $Data[$K][0] . '<br>'; echo 'Day: ' . $Data[$K][1] . '<br>'; echo 'Time: ' . $Data[$K][2] . '<br>'; echo 'In Charge Person: ' . $Data[$K][3] . '<br>'; echo 'In Charge: Email: ' . $Data[$K][4] . '<br>'; echo 'Event: ' . $Data[$K][5] . '<br>'; echo '</p>'; } echo $today; ?> Link to comment https://forums.phpfreaks.com/topic/87000-filter-data-from-a-flat-database/ Share on other sites More sharing options...
bbmak Posted January 21, 2008 Author Share Posted January 21, 2008 here is the live action http://mak.ghaben.com/scheduler/read.php Link to comment https://forums.phpfreaks.com/topic/87000-filter-data-from-a-flat-database/#findComment-444884 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.