Select recent threads based on board's view access [SOLVED]

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Cirdan
Forum Contributor
Posts: 144
Joined: Sat Nov 01, 2008 3:20 pm

Select recent threads based on board's view access [SOLVED]

Post by Cirdan »

So I'm trying to create a list of recent threads based on date, the the thread's board's view access level. I have this query:

Code: Select all

SELECT *
                   FROM r_forum_threads
                   JOIN r_forum_boards ON r_forum_threads.board = r_forum_boards.id
                   WHERE r_forum_boards.access_view <= $view_level
                   ORDER BY date DESC
                   LIMIT $count
However, the id column from the r_forum_boards is overwriting the id from r_forum_threads(I assume because both columns have the same name.) The only thing I want from r_forum_boards is the access_view column.

SOLVED

I changed the select to: SELECT r_forum_threads.*
Post Reply