this really is my plan:
board(name, catId)
cat(id, catName)
userBoard(boardName, username)
msg(boardName, username, title, text)
assume the username is "foo". i'm trying to offer the following but have no idea how to get it done. i'm thinking about natural join of
userBoard.username = "foo" AND userBoard.boardName = board.name AND board.catId = cat.id AND msg.username = "foo" AND msg.boardName = board.name
what will be the query for MySQL?
UPDATE: i didn't remember to say that i'm thinking about the next came back values
`board.name, cat.catName, msg.title, msg.text`
Do this:
Select b.name, c.catName, m.title, m.text
from board b
inner join Cat c on b.catId = c.id
inner join userBoard ub on b.name = ub.boardName
inner join msg on m b.name = m.boardName
where ub.username = "foo" and m.username = "foo"
You will have to choose the kind of join according to give me an idea to choose out of your tables.
select b.name, c.catName, m.title, m.text
from board b
inner join cat c on b.catId = c.id
inner join userBoard ub on b.name = ub.boardName
inner join msg m on b.name = m.boardName
where ub.username = "foo" and m.username = "foo"