I have a flat file db that contains a listing of movies that consist of :: type, name, description and a rating
the file looks similar to this (ive trimmed it down and cut parts of the description for time and effort sake) ::
(the && are the field seperators and each film is on its own line)
Action&&Die Hard&&Bruce Willis .... &&3
Comedy&&Space Balls&&Star Wars Spoof with .... &&2
Science Fiction&&Star Trek: Insurretion&&The Federation ....&&4
etc.
What I want to do is for my script to sort these according to the what the visitor clicks to sort by.
For example if they click on "sort by name" then it would look like:
Action&&Die Hard&&Bruce Willis .... &&3
Comedy&&Space Balls&&Star Wars Spoof with .... &&2
Science Fiction&&Star Trek: Insurretion&&The Federation ....&&4
etc.
But if they click sort by rating it would look like:
Comedy&&Space Balls&&Star Wars Spoof with .... &&2
Action&&Die Hard&&Bruce Willis .... &&3
Science Fiction&&Star Trek: Insurretion&&The Federation ....&&4
etc.
and so on
Is this possible?
If not, is it possible to just list them according to name?
ive searched on here and the perl forum but i cant find anything regarding what I want to do. I can't be bothered to have a sig!
the file looks similar to this (ive trimmed it down and cut parts of the description for time and effort sake) ::
(the && are the field seperators and each film is on its own line)
Action&&Die Hard&&Bruce Willis .... &&3
Comedy&&Space Balls&&Star Wars Spoof with .... &&2
Science Fiction&&Star Trek: Insurretion&&The Federation ....&&4
etc.
What I want to do is for my script to sort these according to the what the visitor clicks to sort by.
For example if they click on "sort by name" then it would look like:
Action&&Die Hard&&Bruce Willis .... &&3
Comedy&&Space Balls&&Star Wars Spoof with .... &&2
Science Fiction&&Star Trek: Insurretion&&The Federation ....&&4
etc.
But if they click sort by rating it would look like:
Comedy&&Space Balls&&Star Wars Spoof with .... &&2
Action&&Die Hard&&Bruce Willis .... &&3
Science Fiction&&Star Trek: Insurretion&&The Federation ....&&4
etc.
and so on
Is this possible?
If not, is it possible to just list them according to name?
ive searched on here and the perl forum but i cant find anything regarding what I want to do. I can't be bothered to have a sig!