need help with radio script

Okay, this part of the error: VALUES (Enter new DJ NAME…, 'M

shows that you are inserting a new DJ, but, you didn’t enter a name for the DJ. It was still the default!

I didn’t give you a user manual… LOL… First, you create a DJ and fill in all the data and select two pixes
one for the DJ and one for the site’s promo display. Then, press UPDATE. After that, you can select that
new Dj and add or remove scheduled shifts. Did that make sense? Hope so…

i have setup a presenter up for now but when go on getpresenter.php i get No presenters scheduled today!

but if i insert the time and day manualy my presenter shows up is there something i need to change for it to match gmt time zone ?

Yes, I am sorry, too many programming chores going on…

Use this line before using and date functions:

date_default_timezone_set(‘Europe/London’);

That should work for you!

have i done this correct cause still not displaying the picture

[php]

Testing: Retrieve and display current presenter! <?php include("my-connect.php"); date_default_timezone_set('Europe/London');

// Locate the current DJ and retrieve their info…
$day = $_POST[‘day’];
$hour = $_POST[‘hour’] * 100;
$sql = “SELECT * FROM shifts WHERE days = '” . $day . “’”;
echo "Searching for DJ’s using query = " . $sql . “”;
$result = mysql_query($sql, $dbConn) or die(“Error in shifts query!
Error: " . mysql_error);
// First, calculate the start and end time of each shift to find the correct shift…
if(mysql_num_rows($result)==0){
echo “

No presenters scheduled today!

”;
}else{
while($row = mysql_fetch_assoc($result)){
$dj = $row[‘presenter’];
$shift = explode(” to ", $row[‘hours’]);
if( ($shift[0] >= $hour) && ($shift[1] <= $hour) )
break 2;
}
// The DJ’s id is found, now retrieve their info…
$sql = “SELECT * FROM presenters WHERE id = '” . $dj . “’”;
$result = mysql_query($sql, $dbConn) or die("Error in shifts query!
Error: " . mysql_error);
$row = mysql_fetch_assoc($result);
echo “

Current Presenter(DJ): " . $row[‘djname’] . “, Name of their picture: " . $row[‘djpicture’] . " and " . $row[‘djpromopicture’]. “

”;
$day=””;
}
echo “
<img src='djimages/” . $row[‘djpicture’] . “’>”;
echo “<img src='djimages/” . $row[‘djpromopicture’] . “’>
”;
?>

Select a day: Select Day Sunday Monday Tuesday Wednesday Thursday Friday Saturday Select hour of day: Select a hour 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 </[/php]

will this display the djs automatically change on the website once i finally work out how
to get the picture on the site

Yes, every time the banner is reloaded or re-displayed or updated, the "current’ DJ will be pulled and displayed.
I think that is just what you want!

Now, lets try debug a little. You have created a DJ for the CURRENT day and hour? I mean, at the location of your SERVER??? Remember, you are typing in days and hours for your shift at your location, and this is London, but the SERVER may be elsewhere… Does the time your server show display as the same as you have on the clock where you are?

Next, you are showing the test code that should display a the two pictures. Okay, perhaps I misled you…
The code you just posted is the TESTING page just to make sure it works. It allows you to manually pick
a day and hour to test if you have a DJ set up for that hour. You are supposed to select a day and select
an hour. Then, press the button and it should pull your data from the database for that day and hour. If
you have not uploaded any pictures for that shift, then it will not display any. Did you fill in your entire
schedule for the entire week? 24 hours? Not sure…

The other shorter code was the “live” code to use for display based on the real-time clock…
Hope that makes it clearer…

Sponsor our Newsletter | Privacy Policy | Terms of Service