I know that there are other posts out there like this, I've been using them. I've got three tables:
users_info
user_id | user_name
blog_comments
comment_id | comment
blog_reply
user_id | comment_id | reply | reply_date
I'm trying to join the tables to get user_name from users_info and to return blog_reply by blog_comments.comment_id
I've been using: mysql structure for comments and comment replies
I'm stuck on the table joins, any help is much appreciated.
$get_replies = ("SELECT
blog_reply.user_id,
blog_reply.comment_id,
blog_reply.reply,
blog_reply.reply_date,
users_info.user_name AS user_name
FROM blog_reply
JOIN users_info ON blog_reply.user_id = users_info.user_id
LEFT JOIN blog_comments ON blog_reply.comment_id = blog_reply.comment_id
JOIN users_info ON blog_reply.user_id = users_info.user_id
WHERE blog_comments.comment_id = '{$comment_id}'
ORDER BY blog_reply.reply_date DESC");
$reply = mysql_query($get_replies);