I am having trouble wrapping my newbie brain around which functions I should be using to get this query to work....
IN English - I want to query the data base knowing what time it is and what day of the week it is and select the next 3 departures that are available....
What I have so far...
// What time is it HERE
$ServerTime = date("H:i:s"); // In NOVEMBER this time was 1 hour behind LocalTime so we need to add one hour
$HourDiff = "1";
$TimeAdjust = ($HourDiff *60 *60);
$LocalTime = date("H:i:s", time()+$TimeAdjust);
// What day of the week is it
$Day = date("w");
// Gather the data that we need for our Query
if ($Day = 0) {
$d = "Sunday";
} elseif
($Day = 7) {
$d = "Saturday";
} else {
$d = "Weekday";
} // We now have a date
// Lets QUERY the DATABASE
mysql_select_db($database_xxxxxx, $xxxxxx);
$query_Schedule = "SELECT * FROM Transportation WHERE Transportation.'Time' > '$LocalTime' AND Schedule = '$d' LIMIT 4";
$Schedule = mysql_query($query_Schedule, $jehmconnect) or die(mysql_error());
$row_Schedule = mysql_fetch_assoc($Schedule);
$totalRows_Schedule = mysql_num_rows($Schedule);
The TIME column in the DB is actually formatted as TIME and as such looks like 05:33:00 ---
Any ideas on how to tweak that query ??? Thanks!