[HELP]selecting from multiple tables

From: Date: Mon, 18 Dec 2000 04:38:31 +0000
Subject: [HELP]selecting from multiple tables
Groups: php.db 
Request: Send a blank email to php-db+get-5308@lists.php.net to get a copy of this message
Hi, I have three tables setup in mysql for a message system. The first has all the messages, author's names, and the unique ids of the categories and subcategories. The second has a listing of all the categories names and ids. The third has a listing of all the subcategories names and ids. All messages must have a category, but they are not required to have a subcategory. It's set up in a tree stucture like below (hope your email client formatted that ok) Main -> subcat -> some message -> another subcat -> even another message -> message -> another message I'm trying to create a query that will select certain messages (with any bound. On one query I might use an 'id' check, on another query I might use LIKE to check the content of the message), the messages' categories, and the messages' subcategories (but only if the message has a subcategory) The problem arises when I try to select from the subcategory table when there is no subcategory. I'm getting very weird results that are either 16-18 of the same row, or the complete lack of all rows that do not have subcategories. Please let me know if this isn't clear. Any help would be appreciated... Best Regards, Bill Zeller __________________________________________________ Do You Yahoo!? Yahoo! Shopping - Thousands of Stores. Millions of Products. http://shopping.yahoo.com/

« previous php.db (#5308) next »