I'm using mysql to store the calendar entries.
I would like it layed out something like this:
August:
Tue 17th: an event goes here
Fri 20th: another event goes here
September:
etc.
the only thing i'm missing is the monthly headers




Posted 27 August 2002 - 03:29 AM
Posted 27 August 2002 - 07:46 AM
Posted 27 August 2002 - 03:14 PM
Posted 31 August 2002 - 02:08 PM
Posted 31 August 2002 - 02:19 PM
$months = array('', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
$x = 1;
while ($x <= 12) {
// This displays the month based on the array, value 0 is blank, value 1 is January, value 8 is August.
echo "$months[$x]";
// In your data, you probably have each even with a month, so you would load all your data for where the month = $x (the month we are printing)
echo "$event";
$x++;
}
Posted 01 September 2002 - 10:44 AM
Posted 01 September 2002 - 11:42 AM
$months = array('', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November',
'December');
$x = 1;
while($x <= 12)
{
// mysql stuff to grab events from the database
$query = "SELECT date, link, news_id
FROM news_content
ORDER BY date";
if (!($result = @ mysql_query ($query, $connection)))
showerror();
if (@ mysql_num_rows($result) != 0)
while($row = mysql_fetch_array($result))
//end of mysql stuff, now formatting and displaying
{
$expdate = explode("-", $row["date"]);
$date = date("d F y", mktime(11, 0, 0, $expdate[1], $expdate[2], $expdate[0] , 0));
// this line fills the variable $month with the number of the month for use when comparing with $x
$month = date("n", mktime(11, 0, 0, $expdate[1]));
while ($month == $x)
{
if ($month == $x)
echo "$months[$x]<br><br><br>" .
"$date <br><br>" .
"$month<br>";
$x++;
}
}
$x++;
}
Posted 04 September 2002 - 08:59 AM
|
|
Query failed: connection to localhost:3312 failed (errno=111, msg=Connection refused).
|
