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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:36:47+00:00 2026-05-14T00:36:47+00:00

Hello I am creating a CMS and some of the functionality of it that

  • 0

Hello I am creating a CMS and some of the functionality of it that the images that are within the content are managable. I currently trying to display a table that shows the the content title and then the associated images, ideally I would like a layout similar to this,

Content Title
Image 1
Image 2
Image 3
Content Title 2
Image 1
Image 2
Content Title 3
Image 1

The SQL the returns the data is actually formed using Codeigniters Active Record class,

function getAllContentImages() {
    $this->db->select('*');
    $this->db->from('contentImagesTable');
    $this->db->join('contentTable', 'contentTable.contentId = contentImagesTable.contentId');
    $this->db->join('categoryTable', 'categoryTable.categoryId = contentTable.categoryId');

    $query = $this->db->get();
    return $query->result_array();
}

The array that is returned is looks like this, I have cut the size down for readability.

    Array
(
    [0] => Array
        (
            [contentImageId] => 25
            [contentImageName] => green.png
            [contentImageType] => .png
            [contentImagePath] => /var/www/bangmarketing.bang/media/uploads/contentImages/2/green.png
            [isHeadlineImage] => 1
            [contentImageDateUploaded] => 1265222654
            [contentId] => 2
            [dashboardUserId] => 0
            [contentTitle] => sadsadsadassss
            [contentAbstract] => <p>Pllllleeeeeeeaaaaasssssseeeeee Work</p>
            [contentBody] => <p>Please work :-( please</p>
            [contentOnline] => 0
            [contentAllowComments] => 0
            [contentDateCreated] => 1265124038
            [categoryId] => 1
            [categoryTitle] => blogsss
            [categoryAbstract] => <p>asdsdsadasdsadfdsgdgdsgdsgssssssssssss</p>
            [categorySlug] => blog
            [categoryIsSpecial] => 0
            [categoryOnline] => 1
            [categoryDateCreated] => 1266588327
        )

    [1] => Array
        (
            [contentImageId] => 28
            [contentImageName] => yellow.png
            [contentImageType] => .png
            [contentImagePath] => /var/www/bangmarketing.bang/media/uploads/contentImages/7/yellow.png
            [isHeadlineImage] => 1
            [contentImageDateUploaded] => 1265388055
            [contentId] => 7
            [dashboardUserId] => 0
            [contentTitle] => Another Blog
            [contentAbstract] => <p>This is another blog and it is shit becuase this does not work</p>
            [contentBody] => <p>ioasfihfududfhdufhuishdfiudshfiudhsfiuhdsiufhusdhfuids</p>

            [contentOnline] => 1
            [contentAllowComments] => 0
            [contentDateCreated] => 1265388034
            [categoryId] => 1
            [categoryTitle] => blogsss
            [categoryAbstract] => <p>asdsdsadasdsadfdsgdgdsgdsgssssssssssss</p>
            [categorySlug] => blog
            [categoryIsSpecial] => 0
            [categoryOnline] => 1
            [categoryDateCreated] => 1266588327
        )

    [2] => Array
        (
            [contentImageId] => 33
            [contentImageName] => portaski.jpg
            [contentImageType] => .jpg
            [contentImagePath] => /var/www/bangmarketing.bang/media/uploads/contentImages/11/portaski.jpg
            [isHeadlineImage] => 1
            [contentImageDateUploaded] => 1265714175
            [contentId] => 11
            [dashboardUserId] => 0
            [contentTitle] => Portaski - new product and brand launch by Bang
            [contentAbstract] => <p>Bang's experience in new product development has helped launch PortaSki &ndash; the pocket-sized device which is set to revolutionise skiing.</p>
            [contentBody] => <p>After developing Portaski's brand identity and positioning, Bang re-designed the product and its packaging ahead of launch in late 2008.</p>
<p>A media and PR strategy was devised and implemented using Bang's close relationship with two of the UK's most influential organisations in the Advertising and Media Buying industries. On-line advertising was supported with editorial reviews in the UK's leading broadsheets and tabloids, which combined with pin-point HTML direct mail to drive consumers to the new e-commerce site.</p>

<p>Impressive month-on-month growth has been achieved since launch, and the direct marketing activity resulted in an unprecedented 2.71% of targets going on-line to purchase a PortaSki.</p>
<p>For further information visit <a href="http://www.portaski.com" target="_blank">www.portaski.com</a></p>
            [contentOnline] => 1
            [contentAllowComments] => 0
            [contentDateCreated] => 1265718184
            [categoryId] => 1
            [categoryTitle] => blogsss
            [categoryAbstract] => <p>asdsdsadasdsadfdsgdgdsgdsgssssssssssss</p>
            [categorySlug] => blog
            [categoryIsSpecial] => 0
            [categoryOnline] => 1
            [categoryDateCreated] => 1266588327
        )

    [3] => Array
        (
            [contentImageId] => 26
            [contentImageName] => housingplus.jpg
            [contentImageType] => .jpg
            [contentImagePath] => /var/www/bangmarketing.bang/media/uploads/contentImages/5/housingplus.jpg
            [isHeadlineImage] => 1
            [contentImageDateUploaded] => 1265284989
            [contentId] => 5
            [dashboardUserId] => 0
            [contentTitle] => Bang launches Housing Plus
            [contentAbstract] => <p>Bang has launched Housing Plus, the new brand for the Central Borders Housing Group, along with new sub-brands Property Care and SSHA.</p>
            [contentBody] => <p>The Midlands based Group, with turnover in excess of &pound;21M, appointed Bang in 2008 following an open pitch of over 40 agencies. Bang's work began with an extensive marketing research strategy that challenged the Group's former positioning and brand structure.</p>

<p>The research unveiled that the housing sector demanded a values-led Group. This led Bang to develop the brave &lsquo;Together for the Right Reasons' positioning for Housing Plus.</p>
<p>Chris Garratt, Marketing Director at Bang explained "The housing sector has witnessed wholesale change in recent years. Much to tenant's dismay, many associations and Groups appear to be losing touch with their roots, we wanted to develop a Group for associations who place principles at the heart of their corporate strategy".</p>
<p>The repositioned sub-brands also play an important role in the Group's revised brand by highlighting Housing Plus' willingness to embrace and nurture individual identities. Chris Garratt continued "By adopting a &lsquo;house of brands' hierarchy from the outset, Housing Plus has sent out a strong message to prospective strategic partners".</p>
<p>Bang handled all aspects of work for the redevelopment of the three brands, including research, brand creation, naming, positioning, internal branding and communications, advertising, the brand launches, building the brands' on-line presence and the creation of a powerful brand film &ndash; which is already attracting significant interest from across the sector.</p>
            [contentOnline] => 1
            [contentAllowComments] => 0
            [contentDateCreated] => 1265285940
            [categoryId] => 8
            [categoryTitle] => News
            [categoryAbstract] => <p>The world at Bang Marketing moves fast, keep up to date w
            [categorySlug] => news
            [categoryIsSpecial] => 0
            [categoryOnline] => 1
            [categoryDateCreated] => 1265283717
        )

I need a way that I can get all the content images associated with the same content title in one group and then display under the content title.

Can anyone help?

  • 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-14T00:36:48+00:00Added an answer on May 14, 2026 at 12:36 am

    But long winded but you could do something like…

    $titles = array();
    foreach ($query->result_array() as $row) {
        $title = $row['categoryTitle'];
        if (!in_array($title, $titles)) {
            $titles[]['title'] = $title;
        }
    }
    
    for ($i = 0; $i < count($titles); $i++) {
        $title = $titles[$i]['title'];
        $this->db->select('*');
        $this->db->from('contentImagesTable');
        $this->db->join('contentTable', 'contentTable.contentId = contentImagesTable.contentId');
        $this->db->join('categoryTable', 'categoryTable.categoryId = contentTable.categoryId');
        $this->db->where('categoryTitle', $title);
        $query = $this->db->get();
        foreach ($query->result_array() as $row) {
            $titles[$i]['images'][] = $row['contentImagePath'];
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I am creating a Windows application (WPF) that is going to be running
Hello I'm creating a GUI and I want the Edit text button to display
Hello I am creating a windows application that will be installed in 10 computers
Hello all I am creating a horizontal menu for a site that needs to
I'm creating an array that needs to hold some empty values like this: $my_array['message']
Hello and thanks for your time, I am creating an application that moves video
Possible Duplicate: Creating makefile Hello, I am trying to create the makefiles and configure
I'm creating a hello world spring project on glassfish 2.1. I'm trying to use
Hello all I am creating a report at work and for some reason am
Hello I am trying to create an animation like creating heart like bubbles but

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.