Thanks for that starting point msound.
I modified the code a little bit, and sure enough, it's pulling the current show out of the database.. For some reason I couldnt get it to enter into a table 🙁 But I'll tackle that later.. For now, I just want to get the current show (Not display it) and figure out the next four shows.
This is the code I currently have, I'm just a bit lost on where to go from here, I'm hoping somebody can point me in the right direction.
I was thinking of maybe getting the current show ID (Primary Key) and incrementing it by one each time the script finds a record, but im not sure whether this would work. (I'm a noob! :rolleyes: )
Here is my code, and I must add that it's sloppy at the moment:
<?php
// The server is 6 hours behind GMT, so I added the offset below.
$offset = date('H') + 6;
$minutes = date('i');
$newtime = "$offset:$minutes";
$day = date('D');
echo $newtime; // I used these to make sure i was getting the right time.
echo "<br><Br>";
echo $day; // again, another debug line for the right day.
$Link = mysql_connect('localhost', 'MYDATABASE_USER', 'MYPASSWORD');
$DBName = 'MY_DATABASE_NAME';
$Query = "Select * from shows WHERE showday = '$day' AND showstart <= '$newtime' ORDER BY `showend` ASC";
$Result = mysql_db_query($DBName, $Query, $Link) or die(mysql_error());
$row['id']+1;
echo "<br><Br>";
while ($row = mysql_fetch_array($Result)) {
echo $row['showstart'];
echo "-";
echo $row['showend'];
echo " -- ";
echo $row['showtitle'];
echo " ";
}
mysql_close($Link);
?>
Thanks for any help in advance guys 🙂
Dave..
p.s. Thora_Fan, I think you may be right 🙂 It would certianly help me.. Thanks for the link 🙂
---EDIT---
I've also just realised that the script is pulling all shows before the current time. I've looked at the query and realised why, im just wondering if there is a way around this?