Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Events Calendar Using MySQL Database


I have a mySQL table listing all the regular events that happen each month for a group according to schedules like, every Sunday or every other Saturday*. How can I make a visual monthly calendar out of this? Basically, I need to produce a list of dates for each of the events happening in a given month. That's where I'm stumped.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Wordpress Calendar Of Events
I want to make a "calendar of events" in a side bar of a blog.
When the mouse hover on it, it will show the users the events of that
days in a pop up window.

"The pop up window" may contains links to other sites, so it should be
wait certain time to let the user click the link....

Displaying Events In A Calendar
I have a calendar that I would like to display some events on. The events are stored in a database but I do not think I am getting the information in the right place and displaying like it should be. I cannot seem to get an event to display on the exact date that it should be displayed on. I can get one event for a whole week but that, of course, is not right. Code:

Web Calendar Group/individual View Events?
There seem to be a lot of web calendars out there and I am having a tough time sorting out which ones to even try - a lot of the more popular ones were created 2 or 3 years ago.
Can anyone recommend a good one that uses php and mysql preferably?

One of the main uses would be for family to indicate their holidays so all in the family can see. Thus, it would require a group/public feature that allows users to see all "public" holidays or just their own holidays.

Sample Month At A Time Code For Events Calendar
I am in the process of rewriting one of my first PHP scripts, an event
calendar, and wanted to share the code that is the core of the new
calendar. My current/previous calendar processed data dates only, this
code is intended to use more thrifty event descriptions (3rd saturday,
last tuesday, etc.) as well as traditional one-of dates.

The core here here is quite spartan, no table logic or or db cruft
included

<?php
//sample code to generate american calendar format for a given month
// i,e. start of sunday on or before the 1st end on te saturday on or
after the last day.
// makes use of mktime's cool liberal calculation of dates.

// Set sample month and year values:
$mn = date("m");
$yr = date("Y");

// Start calendar logic:

$firstday = date("w",mktime(0,0,0,$mn,1,$yr));// Get first day of
target month (0=sum 6=set)

$numdays = date("t",mktime(0,0,0,$mn,1,$yr));// Number of days in
target month

$daystop = $numdays+(6-date("w",mktime(0,0,0,$mn+1,0,$yr)));//
Adjusted last saturday of calendar page (on or after last day of month

//start with american first sunday on or before start of month of
calendar page and end on daystop (saturday)
for($daynum = 1 - $firstday; $daynum <= $daystop; $daynum++) {

//need working date timestamp to work out details of the calendar
$wkdate = mktime(0,0,0,$mn,$daynum,$yr);//the first of the month -
unix value

$wdy = date("w",$wkdate);//day of the week (0 sun - 6 sat)
$wmn = date("m",$wkdate);//month
$wdt = date("d",$wkdate);//date

$wdte = date("D, m/d/Y",$wkdate);//date string of current date "Day,
mm/dd/yyyy"

Auto Delete Date Based Calendar Events
Out of both wanting to improve my PHP skills and necessity, I created my own small CMS for a non-profit site I am involved with. One of the features I have is an event calendar where other users can submit  events, which then go into a "holding tank" until I can approve or deleted them. It's working great and everyone is loving it... but I have discovered one issue. When the date of the event passes, I have to log into the admin area and manually remove it. I am actually not deleting it from the database but changing a field variable and archiving it for our records.

I have been trying the past few days to come up with the necessary PHP to automatically check the current date (today's date) against all the calendar events and remove ones that have already happened. I could then hook this up to a CHRON action in my hosting CPanel and call it a day - at least that is how it all plays out in my head. 

I imagine in order to point me in the right direction you will need some information about my database.

Calendar Database Design
I've been racking my brains over this one, searched t'interweb countless times, and keep coming up with things that are too complicated.

I want to build a calendar display page, with dates "blocked out" to signify that i'm busy. I want to be able to select sate ranges that i'm busy, and to be able to delete blocks if my schedule frees up.

What I can't figure out is the best database design for this. How would it be best to insert a date range into a database, and pull it out again? Code:

PHP, MySQL Calendar
I wanted to run this idea past you. I am looking to create a PHP Calendar with a MySQL Backend. How is this going to work? I have NOOO idea!! Here is what I need it for:

I am a resident assistant, and am looking to make a calendar system to schedule duty. Only one person is on duty during the weekdays (Mon, Tues, Wed, Thurs, Sun) and two people are on duty during the Weekends (Fri, Sat).

There needs to be an input system where one RA can go in and say that Person A is on duty on Weekday X of Month Y of Year Z or Person A and Person B are on duty on Weekend Day X of Month Y or Year Z.

I also want to be able to keep track of how many weekdays/weekend days each person has for each month.

I would like to be able to display all of this in a calendar (which can be an html table or whatever).

Does anyone have any ideas as to how I can implement this? (sql table columns, dealing with different amounts of days in each month, etc.)?

PHP/MySQL Calendar Compare Question
Most of the events in the calendar are all-day affairs, but some occur at
specified times. So I have two separate fields in the event table, one for the
DATE (required) of the event and one (optional) for the TIME of the event. For
events that span multiple days, I have them enter the event once per day, but
could automate that sometime.

ANYWAY, here's my question:

When I am displaying a calendar, for each date in the month displayed, I search
the event table for events on that date. BUT, I was not able to use an = in the
where clause, I guess because a date in MySQL always has the hours, minutes, and seconds attached. I played around with trying to change the $dateToCheck so it had hours, minutes, and seconds attached, but somehow never could get it right.

I ended up with a query like this:

SELECT * FROM $thisTable where START_DATE >= '$dateToCheck' AND START_DATE <
'$dateAfterToCheck'

Is there a more elegant way for me to accomplish this?

Day View Calendar / Mysql Entries
I am trying to create a day view of a lab resource reservation system. So far, I've been able to generate a day view table with php, using variables for start time, end time and periods. Periods represent intervals on the day view.

I have two columns in the table:  the first one starts at the start time (say 8:00) and there is a row for every time until the end time, each row time being increased by the period, ie. 8:00, 8:30, 9:00 where the period is 30 minutes and the end time is 9:00.

My second column in the table is filled with unix timestamps representing the date for that particular row, so the 8:00 row on July 1, 2007 is represented by a timestamp of 1183291200. I then created variables to represent start and end times and date of a reserved lab resource. I did a little switch statement in my second column of my table saying, if that row's timestamp equals the start or end time of my reserved resource, than give it a certain style.

All well and good, except I need to tie this into a mysql database where the reservation details (start, end, date) are stored.  Where I am getting fuzzy is how to integrate the query results from the database into my little system.  I would like to have that second column pick up the results from my query and display the reservations, but I'm not sure now to do that. I'd like to post the code here, but I'm not sure how to post php code on these forums without getting yelled at for doing it wrong (I did that once, can you tell?)

Range Of Dates For Mysql To Flash Calendar
I have a database that stores records of calendar events that can range in length (eg- from jan 02 to feb 13). I have a flash web interface that takes in specifically formatted date variables (eg- “&01022002=on this day we go to the park”).

The interface between the two formats the entry. Previously each record from the db could not be a range of dates so it was easy to format. Now, I have to figure out a way to overlap different ranges of dates so it will work.

Can anyone tell me if this has been done before in a similar application I could look at or else point me in the right direction?

Populate A Calendar Page With MySQL Data
I'm trying to figure out the best way to populate a Calendar page with data from a database.  I have the code that will generate the Table with Days of the week, but I'm at a loss on how to populate this with data from a database.

Do I build the calendar and then for every day that I generate a cell, query the DB or should I load the DB in an Array and compare that to the date of the cell?

Php Events Box
Is there a way to get the PHP code to read a line from the table and write it in a box? What I have is an events table with two columns, Date of Event & Name of Event. This is saved on a page called events.html (can be changed to .php) What I wan is on index.php I want a next event box.

So what I want for it is to read from the events page, and find when the next event is, using information on dates. I have no idea on how to start this at all.

Scheduled Events
possible to get php to execute a script at certain times a day ? or is the only way to have a list of set times in a db, and when each user comes to my site see if it has been done or not ? and do, or dont do accordingly?

Timing Events
I would like to be deleteing certain records from my database automatically after every 72hrs. I have never tried this before  but is it possible to perform actions after a certain duration of time in php ?
 

What Is Indexing In Mysql And How It Will Be Useful And How We Can Retrieve Database Content Easily From A Database Table Containing About 5lakhs Datas
I need to select data from a database table containing huge amount of
data. Now I am storing data using one primary key and I am just using
simple select statement, and this process gives me the output but it is
taking long to execute the query. As much I had heared I want to use
some indexing or cluster indexing which might help me but I am not so
familiar with these things.

How To Catch System Events
I have a site from which people can download files. If they cancel the downloading in-between then my page hangs. Does anyone know how to catch system events like "Cancel" in PHP ?

Events Application In PHP Or Perl
I am looking for an events registration/calendar application (open source or otherwise) written in PHP or Perl.

It would need some (or all) of the following capabilities:
1-Allow admins to create/edit/delete events including:

a) Max number of attendess
b) Event registration fees

2-Allow admins to run reports per event on the number of attendees, who has paid ,etc

3-Allow event attendees to register and pay for the event(s) via the web (Paypal).

I would prefer there be different levels of administration privileges, like full admin, reporting only, and per-event administrators.

The most important features are the ability to pay via the website via PayPal and the admin capabilities.

Export Events To Outlook
Do anybody know how to export events to Outlook from a php script? I'm
making a list of events, and my idea is that when the user clicks on
the event it will be exported to his or hers Outlook-calendar. I don't
want to force the users to install any software (like a RSS-reader).

Events Calander And Date Conversion
I have been working on an events calander program that needs to be in chronological order by date. The fields I have are id, date, event and event discription. The problem I have is that the event date needs to be displayed in this format 09/21/03. However, when I simply sort by date 02/21/04 would display before 03/21/01. How could I sort by date and display the date in the 00/00/00 format.

Automatic Display Of Events Each Week
I know how to display a list of upcoming events from a SQL database, but am wanting to display the events based on the date, eg. events happening this week only. Could someone tell me how to do this or point me in the right direction please?

Multiple Dates For Recurring Events
how I could add multiple dates for the same activity that recurs many times in an events calendar?  Now I am creating an entirely separate entry for each event; it all works fine, but it's mighty tedious! Code:

Code Relating To Button Events....
I have one screen that has multiple buttons/images for varying actions. How do I trap which button/image was clicked in order to carry out the related code events?

Do I utilise the value of each button, or the name of each button to identify, and then 'select' the result? Should they all be type=submit?

OnUnload (check If Variable Is Set) Events To Detect Browser
I'm building a website using PHP/JavaScript/HTML. I am using sessions. I need to find out how to do two tasks.

1. Log the time when the user is done using the website. I am using the onLoad (set a variable) and onUnload (check if variable is set) events to detect browser close. But this doesnt let the page to be refreshed or the 'Back' button to be used. (I am ensuring that the time is not logged when the user clicks a hyperlink by resetting the variable.) Is there a way to let the user use the back button and refresh without logging him out?

2. I need to make sure that only one user logs into the site using a username. What is the best way to do this? I have the usernames stored in a database. DO I set and reset a flag when a user logs in or out?

Copy And Paste On MySQL To MySQL Database
Would there be any issues if i literary Copy and Paste a mysql db from one server to another mysql db server? When i say "copy and paste" is just like tranferring one word doc from one pc to another pc.

I tried the copy and paste already and the new server had recognize the DB i had pasted. I just want to confirm if there would be issues doing it so.. Or should i use Mysql.com Migration toolkit?

Php/Mysql- Uploading Mysql Database
I've set up a basic database using Mysql (just creating a web blog I followed a tutorial) and then started writing the php code for interacting with the database. how do I put the Mysql database onto the the web server where I have server space (the server I use is just some company that I pay €100 a year for). I need the php file to get the data from the Mysql database...

Getting A Value From MYSQl Database
I want to get the value from a field in the database using the following PHP code:

$sql = "SELECT Paper_id from Papers WHERE Title= '$Paper_Title'";
$PaperID = mysql_query($sql);

However this returns some wierd response: "Resource id #2" how do I just get the value of the field in my new selected table which is 1*1.

Pop-up Calendar
Where can I find a script for a pop-up calendar for a user to select a date to enter in a field.

Calendar
I have a simple calendar script which displays a calendar on my website and at present, you enter dates using a seperate xml file.

If you enter an event for a certain date, the event is displayed next to the date. This is fine, all works great, but what I would like to do is actually display the event in a pop-up window.

So you would click on the date , a pop-up window would appear with the event displayed.
PHP Code:
    

Php Calendar
I'm looking to develop a simple php calendar/schedule - similar to outlook calendar - that does not rely on a database but rather writes to a file. I need to be able to add to/delete from the schedule. As I am only starting out with php I am a little confused by the codes which links to databases and how to adapt them to only write to a flat file.

Calendar
It's two calendars, side by side and in reverse order (May/April). First you enter your Zip Code (have DB set up ewth UPS codes, zones, and shipping dates), then you click on the date you'd like to have your borchures delivered by.

A red sphere will appear on the delivery date, preceded two or more days (depending upon the DB results) with a yellow sphere designatng the shipping date. 5 days before that, a purple sphere, represnting the date the press is run. Two days before this, a green sphere represnenting when you'll receive (and hopefully approve same day) your proof. Back up two more days and a blue sphere represents the latest date you must upload your files to the printer.

PROBLEM: ANy sphere falling on a weekend miust be backed up to the prvious Friday. Sounds simple, but it's proving otherwise. Maybe I need to start all over and re-evaluate my approach. First problem, because of the way I've designed the script, is getting
balls to fall into the previous month if necessary, but I won't worry about that now.

The BIG problem is getting Saturdays and Sundays ($wday ==0 && $wday==6) to back up.
Here's a simplifed excerpt of what I've tried so far. Code:

Calendar
how can i make a calendar on my php page?

PHP 5 Calendar
Is there PHP5 calendaring software that will allow you to import events
from other calendars? For example, I have a Master project calendar
that my satellite sites want to import. They import the calendar and
now they have all my dates and theirs as well.

Calendar
Can anyone direct me or supply a simple free calendar for use with one of my pages please?

Calendar
I am wondering someone could please tell me how I can create a calendar? The way this one looks. I am wanting to highlight dates that are in a database. Using php, mysql and Javascript to build it. I don't want someone to build the calendar for me. I want someone to either guide me or show me one that already built.

Calendar
I have a simple calendar below. How would i go about attaching it to a database and saying If theres an event change the day colour and add a link. I followed a tutorial for this and i am a little unsure. Code:

Calendar
I'm looking for a calendar where I can simply browse the next | Previous months, and then when I click on a date in the calendar it simply passes the date clicked on to the address bar so if I clicked on today's date it would pass something like:- Code:

Calendar
I was messing around with this calendar and for some reason it likes to skip january when you moved back in the calendar and when you move from december forward it skips january and february and goes right to march.. there must be something wrong with my logic but I cant figure it out. Code:

Calendar
Ive found a simple calendar that displays all the days of the month as a link. I have saved the code below as eventcalendar.php and what I would like is when the user selects a certain day, that will take them to a page saved as eventinfo.php with the events for that day. I have managed to point each link to eventinfo.php, I'm just struggling to pass the actual date to that page, any ideas? Code:

Help With MySQL Database Retrieval
I am a total newbie and I am having problems retrieving multiple rows from a database...

when I try to get a printout of the whole table, I get the following error:

Warning: 0 is not a MySQL result index in C:HTTPDHTDOCStest.php3
My code is as follows:

<?php
$db = mysql_connect("localhost", "root");
mysql_select_db("test",$db);
if ($myrow = mysql_fetch_array($result)) {
echo "<table border=1>n";
echo "<tr><td>Name</td><td>Position</td></tr>n";
do {
printf("<tr><td>%s %s</td><td>%s</tr>n", $myrow["first"], $myrow["last"], $myrow["address"]);
} while ($myrow = mysql_fetch_array($result));
echo "</table>n";
} else {
echo "Sorry, no records were found!";
}
?>

Check To See If Value Is Already In Mysql Database
I am looking for the most efficient way to check and see if an inputed email (via form) is already in the database under the column 'Email'.

Pdf Files In A Mysql Database
I have a mysql database which I reach with php-code.

I want to be able to download and open files I have stored(as a BLOB) in the database. Downloading and opening word documents and textfiles give no problems, but PDF-files aren't possible to open.

Has anybody the same troubles, or does anybody know a solution for this problem?

Insert Into Mysql Database
It sounds very simple, but for some reason I just can't figure it out, and it will save a lots of time to me, if someone can direct me into the right direction. I was trying to input data into mysql table through post method, but it was not working. I made it simple and just tried to enter anything from a php file, but it does not work, so there is something that i am doing wrong with the insertion query.

$link = mysql_connect($hostName, $userName, $password);
echo("connected");

mysql_select_db($databaseName, $link);
echo("database selected");
echo ($databaseName);

mysql_query("INSERT INTO image VALES('','','','','','','','','', 'hello', '', '', '','','','','')", $link);

echo ("done");

I am trying to enter into one of those fields, but it does not populate the table in mysql database.

Cant Connect To Mysql Database
I'm having a problem connecting to a database, when i use the following script to connect to a database (all the login details are correct) it connects to mysql but says it can't connect to the database any body got any suggestions...

Creating A New MySQL Database
I run a small horse racing based website that has a 'fantasy league' type competition each season. Last year i looked after all the entries, leaderboards etc.. using excel and copying and pasting to webpages each week.

However this year i am going to attempt to use MySQL and PHP to have it automatic bar result entry. I have built a basic php and MySQL site before with the usual insert, edit etc.. But this one will need features im not sure how i go about making.

Basically there will be a list of horses (around 150) divided into 4 grades. Entrants pick 2 horses from each grade so a total of 8 horses. Winning horses score 5, 2nd = 3 and 3rd =1.

I was thinking of having the following 2 tables - one for the horses - listing their name and grade. One for entrants - the peoples contact details and their chosen horses.

However from there im not sure how to able to enter the latest results and how i can create a leaderboard page and list the points each horse has. I was thinking of a new table with a row for each result showing horse name and points scored but i then dont't know how this table can be used to create a column on the horse table that lists each horses total points. And also how it can be used to create the total points each entranant has got so far (i.e. the total point for all 8 of their horses)

Mysql Database Problem
I installed php4,MySQL,Apache on my Windows98 system. Everything works up to the point of connecting to Mysql. Then I can't get it to do anything else.
this works to connect:

$connection = mysql_connect("localhost", "user", "xxxxxxxx")
or die ("couldn't connect");
if ($connection) {
$msg = "success!";}?>
But when I try to anything like create a database I get the errors (in this case 'couldn't create database'.)

<?
$new_db = "cosmos";
$connection = @mysql_connect("localhost", "user", "xxxxxxxxx") or die ("Couldn't connect.");
$result = @mysql_create_db($new_db,$connection) or die ("Couldn't create database");
if ($result) {$msg = "<p>Database has been created</p>";}?>


Create Mysql Database?
How do I make PHP create a database for mysql please?

I can see how to make tables and I have read all the documents
I can find but I don't understand how to make the database itself.

All the tutorials I can find seem to bypass the issue by ignoring it?

Copying From One Mysql Database To Another
Is it possible to open a connection to two separate mysql databases in order to copy the data from one table in the first database into a table in the second database? I'm assuming the answer is yes, but I'm confused as to the proper php syntax.

Pictures Into A MySQL Database
I need to put pictures in to a MySQL -database with PHP and also be able to view them on a web page with PHP.

How I Setup My Mysql Database(s)...
Quick question on how I setup my mysql database(s)...

If my setup is such that I have multiple clients, and each client gets
10 tables to store their data, is it better for performance if I put all
of these tables into 1 large database (with a unique identifier
prepended to each one) or create a separate database for each client?
i.e., assuming 1000 clients, I either would have:

A) 1 database and 10,000 tables in it, 10,000 total tables

B) 1000 databases with 10 tables in each, 10,000 total tables

Intuition tells me that the multiple databases would be better for
isolating data between clients, but I am not sure if this would slow
things down.

All the info I found on this online was inconclusive and mostly was
people speculating, so I hoped you all could help more.


Copyright © 2005-08 www.BigResource.com, All rights reserved