Interesting question...

Libraries traditionally use "Distillers, The" but really this is a hold over
from the card catalogues where if they didn't do it that way the "T" section
would be over half of the catalogue.  Also it's easier for people to notice
that the library puts the "the" second but looking for "The Distillers" and
not finding any "The..." than it is to notice the opposite but searching for
"Distillers ..." and not finding any.

But think beyond the card catalog...  This is 2002 not 1802.

How about a column title which is accurate (whatever is on the official
album - er... CD or MP3 ID tag).  But then have a second table with a word

  id  int,
  type  int,
  word      varchar(80)

Where id is the id of whatever used that word, type tells you what that was
(in your case an artist name, album name or anything else you intend to
track) and word is the lowercase (to make it case insensitive) word you're

So if we have "The Distillers - Sing Sing Death House" and "The Grateful
Dead - Terrapin Station" and "The Bobs - Cover Songs of ..." Your table
might look like:

  id   type   word
 ----  ----  --------
  1     1     the
  1     1     distillers
  23    2     sing 
  23    2     sing 
  23    2     death
  23    2     house
  3     1     the
  3     1     grateful
  3     1     dead
  12    2     terrapin
  12    2     station
  2     1     the
  2     1     bobs
  15    2     cover
  15    2     songs
  15    2     of 
  15    2     ...

Isn't this more of a pain in the ass?  Well yes but not that much and
consider the huge benefits it can offer.

You search on this table by breaking off of the words your end user submits
into single words and do a group by sorting by count(*) desc -- you'll get
relevance and if I searched for "Sing Sing Dead House" or "The Dead" --
which would fail under your design here we would find something (true "The
Dead Kennedys" would rate as high as "The Grateful Dead" but they would both
be there).

If you add a third type for song titles you're really cooking now.

Queries can be restricted by type and re-run if the first finds nothing.
Good Luck,

On 2/24/02 10:19 PM, "[EMAIL PROTECTED]"

> From: "Jonathan Underfoot" <[EMAIL PROTECTED]>
> Date: Sun, 24 Feb 2002 13:35:43 -0500
> Subject: "The" Debacle
> I'm putting together a table with bands, and I have a slight problem.  Well it
> not really a problem as much as I'd like some input from more seasoned
> professionals.  Certain band names begin with "The" but when listing them it
> would be of great advantge to me to remove the "the."  Has anyone else faced
> this dilemma?  I was thinking that when inputting and editing band names that
> I could just scripot a new column with the comma in place.  I suppose librarys
> have this difficulty as well.  So what is it?
> Column 1 - "The Distillers"
> Column 2 - "Distillers, The"
> Or a bit of PHP programming every time I list them (seems more difficult.)
> Either way, does anyone have the propper PHP function I should use?
> Thanks much...
> -Jonathan

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to