MySQL Forums
Forum List  »  Newbie

Order table by record insert order
Posted by: Michael Perks
Date: August 30, 2008 09:37AM

Hi everybody,

I have a table named 'Cast' which have fields 'FilmId' and 'Name', *both are key fields together* (<- Could be causing my problem??)

The problem is that I have a page where I can edit film information, I put the cast in text input boxes in order of preference (i.e. main actor -> minor actor order), then loop through the text boxes and insert it to the database.

For example for 'The Dark Knight' (FilmID is 431), I insert in the order of:

FilmID | Name
431 | Christian Bale
431 | Heath Ledger
431 | Aaron Eckhart
431 | Morgan Freeman

But when it is saves to the database, it displays it in alphabetical order:

FilmID | Name
431 | Aaron Eckhart
431 | Christian Bale
431 | Heath Ledger
431 | Morgan Freeman

At the moment my table is in order of FilmID Ascending, which I want to keep.

So it there a way to order my 'Cast' table by FilmID Ascending and then by Name 'In order of insert'.

Thanks for your help.
Michael.



Edited 1 time(s). Last edit at 08/30/2008 09:38AM by Michael Perks.

Options: ReplyQuote


Subject
Written By
Posted
Order table by record insert order
August 30, 2008 09:37AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.