I have been trying to figure something out here and am having problems. What I have is a problem with outputting some info in a table. Here is what I have and the problem is in the "getstart_end" function. This should be a working copy if you want to run it and I have put in some sample times.
// $dend is actually how many hours from the start time. It is not a
clock time in itself.
// So that would mean that a $dstart of 07:00:00 and a $dend of 6:00:00
would actually make
// the $dend time 13:00:00 (1pm)
// This just creates the table and works
$result=mysql_query("CREATE TEMPORARY TABLE IF NOT EXISTS aplayabletimes
// This just populates the table in 5 minute increments and works
$result=mysql_query("INSERT INTO aplayabletimes
/ / This deletes times from the table and works
$result=mysql_query("DELETE FROM aplayabletimes WHERE min > '$dstart' AND
min < '$dend'");
// Here is where I am having problems. I need it to give me the start time
// And the end time. There can be gaps in the table for times.
// It starts at 00:00:00 and goes to 23:55:00 (in 5 minute
increments). Once time frames are deleted,
// it could have times from (example) 07:00:00 - 13:00:00 and another time
// 18:00:00 to 21:40:00. What I need it to do is to output like this:
// "First Start Time - First End Time" newline
// "Next Start Time - Next End Time" newline
// etc....... (because there can be multiple start and end times)
// To determine if there is a new time block, there would be more than a 5
minute gap between
// the end of one time block and the start of another time block.
// The $i is just to grab the first block and I know there has to be a
better way then this to do that too.
$result=mysql_query("SELECT * FROM aplayabletimes ORDER BY min");
echo $row->min . " - ";
// This just deletes the temporary table
$result=mysql_query("DROP TEMPORARY TABLE playabletimes");
Thank You in advance for any help that you can give me on the problem.
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
- [PHP] query question Jacky
- Re: [PHP] query question Markus Fischer
- RE: [PHP] query question Maxim Maletsky
- Re: [PHP] query question Steve Buehler
- [PHP] query question Kelly Meeks
- [PHP] Query Question Karl-Heinz Schulz