Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8374447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:55:30+00:00 2026-06-09T14:55:30+00:00

t_message msg_id message username date_post url t_comment com_id comment msg_id username date_comment url How

  • 0

t_message
msg_id
message
username
date_post
url

t_comment
com_id
comment
msg_id
username
date_comment
url

How can I show comment based on msg_id ?
Example :

john posted message : welcome to my world.
Then jane commented his message : welcome too.
and greg commented too : welcome boss…

other jane posted message : i’m happy today.
then Greg commented her message : wow…

Should be each will be different show right ?

Any suggestions ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T14:55:31+00:00Added an answer on June 9, 2026 at 2:55 pm

    To retrieve comment based on msg_id

    SELECT c.comment,c.username from t_comment c 
    left join t_message m on c.msg_id=m.msg_id 
    where c.msg_id={your msg id} 
    order by c.date_comment
    

    To retrive comments and message based on a msg_id

    select * from
    (select m.message,m.username,m.date_post as date_p,m.msg_id from t_message m
    union
    SELECT c.comment,c.username,c.date_comment as date_p,c.msg_id from t_comment c 
    left join t_message m on c.msg_id=m.msg_id )t
    where t.msg_id={your msg id} 
    order by t.date_p
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

for some reason I'm experiencing the Operational Error with can't rollback message when I
Error message doesn't display on mysql connect failure if( ! $this->remote_connection_id = @mysql_connect($vars['hostname'], $vars['username'],
I have the following error message: SQLSTATE[HY000] [2003] Can't connect to MySQL server on
Seems like cuke doesn't show the full error message (at least when problem occurs
I'm getting the following error message and I can't seem to figure out the
How can i send a message between an activity and a thread if put
I have models User and Message. Every user can send messages to other users.
How can I set the SMTP message-id while sending mails with javax.mail . My
I need to create a message system, where a person can have a conversation
How do I show a message from the php action script of a form?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.