Is there an easy way when ordering to have titles beginning with "the " or "a " to be ordered by the following word, or do I need to do it with my programming.
At this point I have been considering maybe having the title have one box for "the" or "a" instead of the title entered all in one box on the form and then when adding it to the DB have a field storing it and so the main field won't start with it.
But if there is some better way to do it, I guess it would be nice knowing. Someone could always enter it with ,the at the end and then the program rearrange it for display, but some tricky things could come up in that case too and plus there would be some words I wouldn't think of to check for at beginnings which also may be better off left out when ordering.
Ordering with the PHP itself is definitely not an dieal option because I am pulling rows with a limit and so I would have to change it and pull every row to even be sure which ones should show and it would be a mess that way.
I would actually consider two solutions.
one is to put a prefix field with the "The" or "a" in, or, save the titles as "Stone, The" and "Wedding, a" as many library records store their book titles in...
if you want it correct, you can always have a function that moves a trailing ", The" etc to the front for printout...
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall
Yeah that's what I was thinking of doing, but was just being sure there was no built in mysql feature to have it automatically omit certain words when ordering. I guess not though, so I will do it some other way. Since some titles of movies have commas in them I probably should just put a separate input on the form for prefixes and then use the php to thus know if a prefix is needed. Then it would be easy.
Sure movies might have commas, but they would probably not end by ", The" or ", A". you just do a new table of suffixes to move, and then a couple of functions that automatically move them back and forth
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks