Jump to content

select values from 2 tables with 1 query


robs99

Recommended Posts

hey,

ive got problem. im trying to kind of combine 2 tables in one query. ive searched and tried to look at examples but i didnt get it to work :( lets say i have 2 tables. one with posts which looks like this:

posts:

post_id, content, author

 

and one which saves the post-id of a flagged post and the user-id of the user who flagged it

flags:

post_id, user_id

 

what i want to do is show whether a post has been flagged or not in one query. lets say display the output like this:

post_id, content, author, flagged (flagged can be true or false)

 

is there a way to do is? sorry for sounding so confusing ive tried to find a solutions for the past 3 hours and my head is about to burst...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.