[eluser]WanWizard[/eluser]
That depends on how you deal with this problem.
I would go for noctrum's query, and solve the display issue in the code:
Code:
$product = FALSE;
foreach ( $query_result as $result )
{
// do we have a product change?
if ( $result->product != $product )
{
// display the product information
$this->load->view( 'product', $result );
// store the product
$product = $result->product;
}
// display the product image
$this->load->view( 'product_image', $result );
}
If you go for separate queries, you have to run N+1 queries (where N is the number of products in your first query), and you still have to create similar logic to process the result of these queries.
You gain nothing by splitting it, you're only making it more complex.