Creating a file - 500pts
Posted on 2006-04-03
I want to create a file based on information held in a table of my database. The file itself is an ICS file (calendar file), however this is not important. The data held in the file is plain text, and follows the structure below:
:-//Mozilla.org/NONSGML Mozilla Calendar V1.0//EN
:The Title of the Event
:Description of the Event
For Each Event
:The Title of the Event (Name of customer)
:Description of the Event (Extra details from the customer database, previous tunings and address)
:Standard numeric time – fixed for all events ( :30)
:Standard numeric time – always 0 ( :0)
The data I would like to retrieve from my database would come from a query holding the fields Summary, Description, Date Start and Date End. For each record on the query I would like a new event created in the file. After running for each record of the query I would like the file to be saved as Calendar.ics. Every time the script is run I would like it to recreate the entire file and overwrite the previous existing one.
Please could you provide me with a script which will do this.