Jump to content

[SOLVED] Struggling with a PHP Event Calendar


boney alex

Recommended Posts

Hi, Im trying to add an event's calendar to my website. I have spent all day trying to get Obsidian's php event calendar to work but with no success at all. What I need is something very very similar to the birthday calendar available from the top nav bar of this forum. I have a reservation table with reservations that have a 'CollectionDate' and a 'ReturnDate'. I'd like to display each record on both of those dates. Any advice/tips/ knowledge of a good script and its whereabouts would be fantastic! Cheers

What format are your dates stored in? If you have them as a MySQL DATE, you could just run two queries to pull the events grouped separately, or if you just want them all together, run a single query like this:

<?php
$today = date('Y-m-d');
$sql = mysql_query("SELECT * FROM myTable WHERE CollectionDate = '$today' OR ReturnDate = '$today'";
if (mysql_num_rows($sql) > 0) {
  while ($x = mysql_fetch_assoc($sql)) {
    // Print out your event here
  }
}
?>

 

Hope this helps some.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.