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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T06:06:36+00:00 2026-05-19T06:06:36+00:00

I need anyones help, i’ll really appriciate that. I have made 2 JOiN-s. As

  • 0

I need anyones help, i’ll really appriciate that.

I have made 2 JOiN-s. As a fact I have 3 Tables

  1. Table with names of Artists (m)
  2. Table with Product iformations, in this case Picture addresses (p)
  3. Table that has id of Artists and id of Products. (pmx)

here’s the SELECT statement:

SELECT
    m.manufacturer_id ,
    m.mf_name ,
    p.product_id ,
    p.product_full_image
FROM
    jos_vm_product_mf_xref AS pmx 
JOIN
    jos_vm_manufacturer AS m ON m.manufacturer_id = pmx.manufacturer_id 
JOIN
    jos_vm_product AS p ON p.product_id = pmx.product_id 
WHERE
    m.mf_chars = 'm'

the effect that I’m trying to achieve is like on [http://www.ugallery.com/ArtistList.aspx?RC=1][1]

and in fact I’m getting just:

  1. Name1 – prod1
  2. Name1 – prod2
  3. Name2 – prod1
  4. Name1 – prod3

I want it, after foreach (smth) { smth } to get:

  1. Name1 – prod1 prod2, prod3
  2. Name2 – prod1 prod2
  3. Name3….etc

    <ul>
    <?php foreach ($this->artistlist as $item) 
                {   ?>
        <li><a href="index.php?option=com_virtuemart&page=shop.browse&manufacturer_id=<?php echo $item->manufacturer_id; ?>"><?php echo $item->mf_name; ?></a>
    
        <a href="index.php?page=shop.product_details&flypage=flypage.tpl&product_id=<?php echo $item->product_id; ?>&option=com_virtuemart">
            <img src="components/com_virtuemart/shop_image/product/<?php echo $item->product_full_image; ?>" height="75px">
        </a>
    
        </li>
    <?php   } ?>
    </ul>
    

this is PHP code that I’m using for now…

So plz, plz, plz…. Can anyone help me?

Here’s the piece of the code

foreach ($this->artistlist as $picture) {
   if(!isset($artists[$picture['manufacturer_id']])) {   <---this is line 22
      $artists[$picture['manufacturer_id']] = array(
         'name'=>$picture['mf_name']
      );
   }

So… the error: Warning: Invalid argument supplied for foreach() in D:\Server\xampp\htdocs\ta\components\com_artists\views\artists\tmpl\default.php on line 35

foreach($artist[‘pictures’] as $pictureId=>$pictureFullImage) { <— line 35

And another additional question:
the outputed HTML is like this:

       <ul>
    <li>
        <a href="/ta/index.php?option=com_virtuemart&amp;page=shop.browse&amp;manufacturer_id=3">Giorgi Mihkeil</a>

**</li><li>** <--- and, can we get rid of this pieces? *<a href="/ta/index.php?option=com_virtuemart&amp;page=shop.browse&amp;manufacturer_id=$picture->artist_id"></a>* <-- what is this link? where does it come from?    
    <a href="/ta/index.php?page=shop.product_details&amp;flypage=flypage.tpl&amp;product_id=1&amp;option=com_virtuemart">
       <img src="/ta/components/com_virtuemart/shop_image/product/Lonely_Boat_4cfa773e83874.jpg" height="75px">
    </a>    <a href="/ta/index.php?page=shop.product_details&amp;flypage=flypage.tpl&amp;product_id=2&amp;option=com_virtuemart">
       <img src="/ta/components/com_virtuemart/shop_image/product/Naked_Couple_4cfbd12805f5b.jpg" height="75px">
    </a>    <a href="/ta/index.php?page=shop.product_details&amp;flypage=flypage.tpl&amp;product_id=4&amp;option=com_virtuemart">
       <img src="/ta/components/com_virtuemart/shop_image/product/Lonely_Boat_4d246dbef30e1.jpg" height="75px">
    </a></li></ul>

now this html give’s smth like: <ul><li>NAME </li><li> <img1><img2><img3> </li></ul>
can we get smth like: <ul><li>NAME <img1><img2><img3> </li></ul> ?

  • 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-19T06:06:38+00:00Added an answer on May 19, 2026 at 6:06 am

    Assuming you’ve got your pictures in an array already:

    $artists = array();
    
    foreach($pictures as $picture) {
       if(!isset($artists[$picture['manufacturer_id']])) {
          $artists[$picture['manufacturer_id']] = array(
             'name'=>$picture['mf_name']
          );
       }
    
       $artists[$picture['artist_id']]['pictures'][$picture['product_id']] = $picture['product_full_image'];
    }
    
    foreach($artists as $artistId=>$artist) {
       echo $artist['name'].': ';
       foreach($artist['pictures'] as $pictureId=>$pictureFullImage) {
          echo "<img src='{$pictureFullImage}' />";
       }
    }
    

    This is a bit more complex than the solution presented by dqhendricks because it doesn’t just store the ID of the artist, but also his/her name. That means there’s an additional layer of arrays involved.

    Based on your comment below: http://pastebin.com/2Cuyvp3U – I think this should do it? Don’t know what the mf_prior field is you suddenly introduced though…

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

Sidebar

Related Questions

Can anyone help, i trying to figure what i need to do, i have
Here I need a help from ur side that Im using the tableview delegate
can anyone help me out with one query? i have a DB that looks
I need help on an algorithm. I have randomly generated numbers with 6 digits.
Can anyone help me out, please? I'm using jQuery. I need to have 5
Can anyone help me out here. I have the Show and Ticket Tables but
I need to customize my table view can anyone help me how to do
Can anyone help? I have a PHP method that sends an http post: <?php
I need some help with an array that I am working on. I am
I need some help with my problem. I have created a list of all

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.