I have two tables (users and posts) and I want to write out all posts (among other things) by one user. I'm thinking I should use a JOIN and WHERE but I get an error for using WHERE.
This is my code:
SELECT username, post, joinDate, title, info FROM users WHERE userId='18' JOIN posts ON users.userId=posts.userId ORDER BY date DESC
I'm new to this and perhaps there is a better way but I can't figure it out atm. Thankful for all answers!