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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:42:01+00:00 2026-05-25T11:42:01+00:00

I am writing an online chat and I have two objects, a chat room

  • 0

I am writing an online chat and I have two objects, a chat room and a chat user. 1 chat room can contain many chat users.

SELECT Chatrooms.created_dt, 
Chatrooms.description, 
ChatUser.first_name, 
ChatUser.last_name, 
ChatUser.email 
FROM Chatrooms
LEFT JOIN ChatUser
ON ChatUser.room_id = Chatrooms.id
WHERE Chatroom.status = 1

this will provide me with rows like


2011-09-08 , I need serious help , daffy, duck, daffy@loony.com  
2011-09-08 , I need serious help , donald, duck, donjuan@disney.com  
2011-09-08 , I need serious help , darkwing, duck, darkcape@aol.com

Obviously I would like to avoid duplicating the chat room information every row. However, I would also like to avoid running multiple queries. I only have basic experience with dbs and as mysql doesn’t have foriegn keys (not sure how that would even help me), I am not sure what better options are.

Is there something better I can do in this situation, or just not worry about the duplicate columns?

  • 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-05-25T11:42:02+00:00Added an answer on May 25, 2026 at 11:42 am

    As far as I know, I don’t believe there is a way to select the information that you’re trying to achieve without either running two queries or having some of the information duplicated.

    I mean essentially what you’re doing is asking the database to fetch you information about the chat room AND chat users in the same query… and unless you could find a way to write that out on a piece of paper using the same columns and data types for every row, it probably isn’t possible.

    So having that said, you probably could just ignore the duplicate data in every row to accomplish your goal.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have something similar to an online chat client. When one user sends a
How can I go about with writing a shell extension to display online files
I am writing a Sivlerlight Chat application using Sockets and the DataContractSerializer. I have
I am currently writing a online game. Now I have to check if an
I'm writing an online game which allows a user to progress from one puzzle
My webapplication is online exam site. when user click on start for writing test,
I am writing an on line chat room based on AJAX/COMET. My design is:
I am writing an online music store (wow!). I have written a shopping cart
You're writing an application that manages online courses. A course is completed in many
I'm writing an online project asset tracker but I'm new to MySQL. What would

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.