mricketts
-
Posts
3 -
Joined
-
Last visited
Posts posted by mricketts
-
-
Thanks everyone. I got it working. I ended up creating a new table with a DATE filed and using the following code:
$result = @mysql_query("SELECT id, date, event FROM eventscalendar WHERE MONTH(date) BETWEEN MONTH(CURDATE()) AND MONTH(CURDATE())+1");
-
I have a mysql database set up with 4 fields - id, month, day, event. The database will be filled with something like: month=Jan, day=4 and event=Meeting. All are text fields. The display will be Jan. 4: Meeting
I can set up the PHP to display the database in a unordered list. The code for this is:
<?php
$result = @mysql_query("SELECT id, month, day, event FROM homecalendar");
if (!$result) {
exit('<p>Error performing query: ' . mysql_error() . '</p>');
}
while ($row = mysql_fetch_array($result)) {
echo '<li>' . $row['month'] . $row['day'] .': ' . $row['event'] . '</li>' ;
}
?>
How can I limit the code to display items for only the current month and the next month?
new web host, now php form not working
in PHP Coding Help
Posted · Edited by mricketts