At 4:34 PM -0400 5/5/09, PJ wrote:
I'm coming up with a bit of a quandry: how to enter and retrieve an
identical book title with different authors.
It is rather unbelievable what contortions one finds as authors :-(
like editors, associations and then the unknowns and anon y mouses.
I suppose one has to get really creative...
Anyone for tea?
You need to normalize.
Authors should have an unique id in an authors table. The authors
table has all the specific information about authors, but not the
books they have written.
Books should have an unique id in a books table. The books table has
all the specific information about books, but not the contributing
Then you connect the two tables with a Book-Author table that has
only the id's of both -- no real need for any other information.
That way when you want to see all the books an author has written,
then you pull out all the records that has the author's id and look
up each book via the book id.
Likewise, when you want to see all the authors who have contributed
to a book, then you pull out all records that has the book's id and
look up each author via their author id.
Do you see how it works?
http://sperling.com http://ancientstones.com http://earthstones.com
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php