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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:20:43+00:00 2026-06-11T07:20:43+00:00

Looking at this array, one can see that only the foo6 value differs from

  • 0

Looking at this array, one can see that only the foo6 value differs from each parent key:

Array
(
    [0] => Array
        (
          [foo1] => Apple
          [foo2] => Banana
          [foo3] => Carrots
          [foo4] => Deer
          [foo5] => Feather
          [foo6] => Grapes
        )
    [1] => Array
        (
          [foo1] => Apple
          [foo2] => Banana
          [foo3] => Carrots
          [foo4] => Deer
          [foo5] => Feather
          [foo6] => Heater
        )
    [2] => Array
        (
          [foo1] => Apple
          [foo2] => Banana
          [foo3] => Carrots
          [foo4] => Deer
          [foo5] => Feather
          [foo6] => Quail Eggs
        )
)

The query:

SELECT
  tpp.page_master_properties_style AS foo1,
  tpp.page_master_properties_bg AS foo2,
  tpp.page_master_properties_data AS foo3,
  tpp.page_properties_style AS foo4,
  tpp.page_properties_bg AS foo5,
  tpp.page_properties_data AS foo6,
  tobj.objects_script AS foo6
FROM templates t
  INNER JOIN category tc
    ON t.category_id = tc.category_id
  INNER JOIN page_properties tpp
    ON t.templates_id = tpp.templates_id
  INNER JOIN objects tobj
    ON t.templates_id = tobj.templates_id
WHERE
  t.templates_id = ?

where ? = 1

This is probably because Table objects has multiple entry for templates_id:

+--------------+----------------+-----------------+
|  objects_id  |  templates_id  |  objects_script |
+--------------+----------------+-----------------+
|       1      |        1       |      Grapes     |
|       2      |        1       |      Heater     |
|       3      |        1       |     Quail Eggs  |
|       4      |        2       |       Milk      |
|       5      |        3       |       Lemon     |
+--------------+----------------+-----------------+

I’m wondering is there any built-in mySQL function that can combine foo6 into a singular array for example to achieve result like this:

Array
(
  [foo1] => Apple
  [foo2] => Banana
  [foo3] => Carrots
  [foo4] => Deer
  [foo5] => Feather
  [foo6] => Array
            (
              [0] => Grapes
              [1] => Heater
              [2] => Quail Eggs
            )
)
  • 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-11T07:20:45+00:00Added an answer on June 11, 2026 at 7:20 am

    This looks like a job for group_concat in the mysql arsenal:

    SELECT
      tpp.page_master_properties_style AS foo1,
      tpp.page_master_properties_bg AS foo2,
      tpp.page_master_properties_data AS foo3,
      tpp.page_properties_style AS foo4,
      tpp.page_properties_bg AS foo5,
      group_concat(tpp.page_properties_data) AS foo6,
      tobj.objects_script AS foo6
    FROM templates t
      INNER JOIN category tc
        ON t.category_id = tc.category_id
      INNER JOIN page_properties tpp
        ON t.templates_id = tpp.templates_id
      INNER JOIN objects tobj
        ON t.templates_id = tobj.templates_id
    WHERE
      t.templates_id = ?
    GROUP BY
      tpp.page_master_properties_style AS foo1,
      tpp.page_master_properties_bg AS foo2,
      tpp.page_master_properties_data AS foo3,
      tpp.page_properties_style AS foo4,
      tpp.page_properties_bg AS foo5
    

    This will group all the rows in tpp.page_properties_data together into the only row of data and split them by commas – which you can then easily explode into an array when you loop through the dataset.

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

Sidebar

Related Questions

I need to write a macro that operates on bitarray looking like this: array[0]
Looking at this jQuery example, how can I modify the code so that it
I have and associated array looking like this: array(225) { [0]=> array(3) { [id]=>
I'm looking for an elegant way to turn this array: Array ( [foo] =>
I have a map array with objects stuffed with variables looking like this: var
Yes, this is a bit of a trick question; one array (without copies), as
One thing that really interests me that I don’t see much written about or
Looking at table on http://msdn.microsoft.com/en-us/library/y1z022s1%28v=vs.80%29.aspx#_core_collection_shape_features I can not see a MFC collection for the
I tried looking this up on here but couldnt find a proper answer. I
Looking at this article: http://www.galloway.me.uk/tutorials/singleton-classes/ I have implemented a singleton, my question is the

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.