Jump to content

Duplicate Query Results


pureDesi

Recommended Posts

It is selecting EVERYTHING in boards for each title in categories. It is then selecting all things in boards for each title in categories.

Very confusing - and hardly ever what you want.

Somehow you need to join the two tables. Such as if boards has a categoriesID or something to say what category it belongs in. Also assuming that categories also has a categoriesID. Ok, so you want to select the boardID, board.title, and categories.title BUT only the category.title that matches the categoriesID in the boards table. Make any sense?

[code]SELECT boards.boardID, boards.title, categories.title FROM boards, categories WHERE boards.categoriesID = categories.categoriesID[/code]

Assuming thats how you link the categories, that should work. Change it as required.

Hope I've been a help.

JP

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.