From: "Rick Proctor" <[EMAIL PROTECTED]>

>
> I have a script that does TV/Tour listings for artist, I need it to sort the
> list automatically so that it goes in date order but I have absolutely no
> idea. I have put together the script with little to no PHP skills so it look
> pretty horrific.

>$listing = "06/24/01/04:00 pm/VH1/Saturday Night Live 25: The Music";
>create($listing, $max_days);


Hi Rick,

Holy smoke, nice code but i would like to tell you about some other ways to handle data.


If you have access to an online database like MySQL (or whatever) you can make one page to enter events into a MySQL database table and then in another page show the events. This will have a data query which sorts the items by date. You can even sort with subsections like by artist fisst and then by date.

If you don't have access to an online database i would say: make a seperate file with the data.
In your codepage:
* read that file line by line and put it in an event-array.
* sort the event-array by date.
* reset the event-array so the index is at the first item (reset ($event_array))
* now go through the array using the while function.


An advanced programmer could make a page in which you could edit that data file through php.

The way the file should look?
Depends. I suggest to use the CSV file ormat as there are free PHP code classes around to help you handle the file and data in it.
A line might look like:
'010624',04:00,'pm','VH1','Saturday Night Live 25: The Music'

(as you see i would put the comlete date in the first field with the YYMMDD format to ease sorting, however you would need to adapt your whole script then...)

Tips to make the production of that event data file easy:

Excel tip: If you enter you stuff in an Excel sheet you can sort it before exporting it as a CSV file.
Excel tip 2: make a worksheet with the top row as labels. Then try menu:data item: form. Voila, a simple data entry form!

<?SPAM
Excel tip 3: I have a nice VBA script to ease data entry in Excel. It shows you a nice data entry form. You can even export the data into some customizable template, ordered! Mail me if you are interested.
?>

Chris
* i do not read my email every day *

--------------------------------------------------------------------
--  C.Hayes  Droevendaal 35  6708 PB Wageningen  the Netherlands  --
--------------------------------------------------------------------

 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



Reply via email to