Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Home made PHP and SQL Calender

Guest
Aug 19, 2007 Aug 19, 2007
I'm making a PHP calender which will output the contents of a database via SQL. At the moment ive got heading (just a quick over view of whats happening), event (more detailed info not shown during the standard calender view), importance (this will simply be a cel colour which I can do very easily without help) and date (day, month, year) as my fields. I'm trying to figure a way of putting something in each field and getting it to come out on the appropriate date on my finished calender.

It's VERY early stages so SQL development hasn't begun yet, I wan't to do this completely by hand (I'm aware theres calender PHP scripts already). I was thinking of making a database containing each month, day and year and if theres something in the specific fields then outputting whatever I've wrote in it, however this will make the database HUGE! Whats the simplist and easiest way to do this.

P.S I also want to be able to have multiple entries for one date
TOPICS
Server side applications
344
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 19, 2007 Aug 19, 2007
"slowpoke115" <webforumsuser@macromedia.com> wrote in message
news:fa99a0$asi$1@forums.macromedia.com...
> I'm making a PHP calender which will output the contents of a database via
> SQL.
> At the moment ive got heading (just a quick over view of whats happening),
> event (more detailed info not shown during the standard calender view),
> importance (this will simply be a cel colour which I can do very easily
> without
> help) and date (day, month, year) as my fields. I'm trying to figure a way
> of
> putting something in each field and getting it to come out on the
> appropriate
> date on my finished calender.
>
> It's VERY early stages so SQL development hasn't begun yet, I wan't to do
> this
> completely by hand (I'm aware theres calender PHP scripts already). I was
> thinking of making a database containing each month, day and year and if
> theres
> something in the specific fields then outputting whatever I've wrote in
> it,
> however this will make the database HUGE! Whats the simplist and easiest
> way to
> do this.
>
> P.S I also want to be able to have multiple entries for one date


Did a calendar extension for ASP once, for data storage it used a simple sql
table containing a EventDate and EventTitle column, the display logic was
something like below

retrieve Events WHERE Date >= first day of month AND Date <= last day of
month
for each Week in the Month
begin table row
for each day in the Week
begin table cell
for each event in selected Events
If(EventDate == day) Print EventTitle
next event
end table cell
next day
end table row
next Week


I hope you get an idea about how to avoid creating a row for each and every
date

Joris

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 19, 2007 Aug 19, 2007
LATEST
slowpoke115 wrote:
> thinking of making a database containing each month, day and year
and if theres
> something in the specific fields then outputting whatever I've wrote in it,
> however this will make the database HUGE! Whats the simplist and easiest way to
> do this.

Just store the date of each event in a DATE column. You can use SQL to
sort or select items by year, month, and date quite easily.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines