Skip to content
Advertisement

MySQL select user motto

I am stuck on this problem and I have been trying to solve for like 2 hours.

I have a posts table which contains all posts. Each post has a column called ownerid which keeps the id of the owner of this post. And it also contains a column called groupid.

What I want to have is to select all posts with a specific groupid (eg. 2) and the motto of the user which is in users table.

So something like this.

JavaScript

But both queries in one line, because I’m using while loop to fetch rows.

JavaScript

Advertisement

Answer

If I undestand correctly your question, you should try

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement