I’m new to PHP, mysql etc. I’ve done some work in VB and Java, and am reasonably fluent in html.
I’m trying to set up a PHP webpage that looks up train times from a schedule that follows the form:
---------------------------------------------------------
| runId | stop1 | stop2 | stop3 | stop4 | stop5 | stop6 |
---------------------------------------------------------
| 1 | 5:00 | 5:10 | 5:21 | 5:34 | 5:40 | 6:00 |
---------------------------------------------------------
| 2 | 5:30 | 5:40 | 5:51 | 6:04 | 6:10 | 6:30 |
---------------------------------------------------------
| 3 | 6:00 | 6:10 | 6:21 | 6:34 | 6:40 | 7:00 |
---------------------------------------------------------
I then want to query the table knowing the current time and the stop number (column title) for the two entries that occur after the present time. So for example if I was at stop3 and it was 5:00 I would want the query to return $time[1]=5:21, $time[2]=5:51 but I would not want any more results to be returned (e.g. there should be no $time[3] = 6:21 set).
Any help would be greatly appreciated, this is a relatively small project, if it makes any difference to how you would recommend setting up the table.
The table should be like this:
And the query: