I'm probably a little dumb, hope someone can help.
I have a simple table with two columns (ID, USERNAME).
I have a comment table for images (COMMENT, COMMENTFROM, COMMENTTO)
COMMENTFROM is the identifier of the user who made the comment. COMMENTTO is the identifier of the owner of the image to which the comment is added. Both users are stored in the USERS table.
I want to output and display lines like this
"really nice photo" - to USERXYZ - from USER123**
This puzzled me, because if I join the USERS table in the comments table:
WHERE comments.userfrom = users.id
This gives me only one (or the other) of the two usernames that I need for each line. Is there a way to get both?
I'm not even sure how I will look for this answer on SOF, I apologize if this was answered. If someone can point me in the right direction, this will be appreciated :)
source share