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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:44:06+00:00 2026-05-26T01:44:06+00:00

This was a bit difficult to explain in the title, but I should be

  • 0

This was a bit difficult to explain in the title, but I should be able to here. I have two tables that look like this:

Table 1:
    -id
    -created
    -last_modified
    -title

Table 2:
    -id
    -parent_id
    -type
    -value

The structure is somewhat akin to the following: an item from table one can have many attributes associated with it. Each attribute is listed in the second table, with a reference back to the original.

The issue I have, is that I want to be able to get a list of records from table 1 to display in a table (using pagination), but also want to be able to retrieve all the attributes from Table 2 associated with each Table 1 record at the same time, so that I might have the following:

(Table 1) ID1 [Title] has attributes x, y, z
(Table 1) ID2 [Title] has attributes x, y, z
(Table 1) ID3 [Title] has attributes x, y, z

and so on. Ideally I would like to be able to associate each attribute with its type as well…currently with a join I receive multiple rows of the same records (with the joined data different each time), and grouping them together removes some of the joined data entirely.

Essentially what I’m after is an array of attributes to be returned for each record from Table 1 (in some sort).

I’m thinking of using MongoDB for this project as I know I can do it simply with that, but I’m trying to do it with MySQL as that is what the existing platform is using.

I hope I’ve made sense with what I’m asking 🙂 Any help would be appreciated!

Dan

  • 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-26T01:44:07+00:00Added an answer on May 26, 2026 at 1:44 am

    Sounds like more of a display problem. The joined query is the best way to go. You’d then just have a simple loop in your retrieve/display code to check for when you transition from one Table1 record to another and adjust the output as necessary.

    You could retrieve all the child records as single fields using MySQL’s group_concat() function, but then you just end up with (basically) a monolithic string of concatenated data, and not the individual records the joinedquery/display loop will provide. group_concat also has length-limits on how much data it’ll return (1024 bytes by default), which can be easily hit with large data sets.

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

Sidebar

Related Questions

This might be a bit difficult to explain but I have two columns in
I have this problem which i find a bit difficult to explain but I
It's a bit difficult for me to describe, but this pseudo C# should explain
This will be a bit difficult to explain but I will try my best.
This is a bit of a difficult problem to explain, but I'm hoping it
So this is going to be a bit difficult to explain, but I'll give
It's a bit difficult to explain but here is the situation: I'm programming a
The question is a bit difficult to explain, but I will try. I have
This might be a bit difficult to explain in writing, so please bear with
Not sure if this has been asked before, it's a bit difficult to explain.

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.