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 8262821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:52:49+00:00 2026-06-08T03:52:49+00:00

I have Two Table One to store Questions and Other to store Replies to

  • 0

I have Two Table One to store Questions and Other to store Replies to Questions as Below

I have Shown the Table Structure and Column in table as Below

Question Table

Question_Id(PK)   |   Question   |   Name   |  EmailAddress

Answer Table

Answer_Id  |  Question_Id  |   Question  |   Name  |  EmailAddress               

What ever question is posted it will be added to Question table and What ever Replies people post will be added to answer table

Now when ever Some one post a Reply to Question I Should Send mail to one who Posted Question and to those who posted Replies to the Question

Please Suggest a mysql Query for the above

Thank you

  • 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-08T03:52:50+00:00Added an answer on June 8, 2026 at 3:52 am

    In theory you should know in the application the id of the question (qid) someone is replying to. Based on this id you can issue the following query:

    Select EmailAddress from Question where Question_Id=qid
    Union
    Select EmailAddress from answer where Question_id=qid
    

    Depending on the logic of your application this might also select the address of the current user. If you want to avoid this you should include in both select statments a condition to exclude the current replier. Something like:

    Select EmailAddress from Question where Question_Id=qid and EmailAddress!=curentUserAddress
    Union
    Select EmailAddress from answer where Question_id=qid and EmailAddress!=curentUserAddress
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two table. One table hold key column and xml column. Other table
I have two tables : one table it matchs and the other is teams.
Quick method description: I have two tables, lets name them table ONE and table
I have two tables. One table contains words. Other table contains points. table words:
I have a database where I store two different kinds of data. One table
I have two table cells, with dynamic content. Table cell one works fine, when
I have two table views, when user clicks one cell of the first, second
I was making one table that have two foreign key to another tables. But
I have two tables. One user table and one table in which results are
Is it a bad thing to have two xml columns in one table? +

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.