edwardoit Posted January 9, 2008 Share Posted January 9, 2008 Subj: Generate 24 hour time and display Data for each time How would it be possible to display a 24hour time format in a html table. I would like to have 1 column for names and 24 columns for $hour. Each $hour, each person has time scheduled of things to do. and it could be he has a lot of things to do. For now, i'm just trying to figure it out how each $things_to_do of each unique $person will display in its scheduled timein the HTML table. I gathered these variables somwhere outhere.... ...and a query ... just to give you idea... $time_table = range(0, 23); #maybe for array time 00-23 that each sched will store into. foreach ($time_table as $time) # i don't know how to use this one... $sql2 = "SELECT name, left(time_sched,2) as time, date_sched FROM schedule WHERE LEFT(time_sched, 2) = ". $time." AND date_sched = '$SearchString' GROUP BY name"; Should I use push_array? ??? or foreach? ??? I really do not know what to do!!! I Really Need Help Here!!! Thanks a lot guys! Quote Link to comment https://forums.phpfreaks.com/topic/85126-24-hour-schedule-prob/ Share on other sites More sharing options...
Ken2k7 Posted January 9, 2008 Share Posted January 9, 2008 date("g") or date("G")? Quote Link to comment https://forums.phpfreaks.com/topic/85126-24-hour-schedule-prob/#findComment-434243 Share on other sites More sharing options...
edwardoit Posted January 9, 2008 Author Share Posted January 9, 2008 date("g") or date("G")? no sir. don't worry with the date. i'll use any date maybe from a search input. if you're willing to help me, just use any date. Or you could have your own idea of what i'm talkin' about here. I just want to have an idea how it works... maybe with array[] or a aimple query and HTML table structure. Quote Link to comment https://forums.phpfreaks.com/topic/85126-24-hour-schedule-prob/#findComment-434255 Share on other sites More sharing options...
Ken2k7 Posted January 9, 2008 Share Posted January 9, 2008 I think you're confusing me. Are we talking about a HTML table or a SQL table? Quote Link to comment https://forums.phpfreaks.com/topic/85126-24-hour-schedule-prob/#findComment-434261 Share on other sites More sharing options...
edwardoit Posted January 9, 2008 Author Share Posted January 9, 2008 ammm.... I want to display HTML table schedule from a query.. sorry for making u confused .. Quote Link to comment https://forums.phpfreaks.com/topic/85126-24-hour-schedule-prob/#findComment-434264 Share on other sites More sharing options...
Ken2k7 Posted January 9, 2008 Share Posted January 9, 2008 Then you can do something like: Make a SQL database with 2 fields. 1 for the schedule and one for the time. So just 2 columns. The time is practically all you need. You can run a query to sort the time so you get the schedule that is most upcoming to the schedule that is least upcoming. And generating the HTML table would be up to you. Quote Link to comment https://forums.phpfreaks.com/topic/85126-24-hour-schedule-prob/#findComment-434272 Share on other sites More sharing options...
edwardoit Posted January 9, 2008 Author Share Posted January 9, 2008 this is what i mean of the table... i don't have any idea of the code behind this. How the time will display into its proper column. Name0 1 2 3... 23 John00:30 00:45 01:15 01:30 01:55 [/td][td]23:00 23:45 Mike 02:00 02:30 02:45 03:30 03:45 03:55 Steve 02:10 02:30 02:45 03:30 03:00 03:25 ??? ??? ??? Quote Link to comment https://forums.phpfreaks.com/topic/85126-24-hour-schedule-prob/#findComment-434297 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.