Welcome Guest, Not a member yet? Register   Sign In
Get Images of an Article
#3

(09-16-2018, 09:46 AM)jreklund Wrote: You never specified the table "products" in your join.
PHP Code:
$this->db->join('gallery''gallery.imageproductid=products.productid' ); 

But if you have multiple images I would make a separate SQL query instead. Or you need to ignore the duplicated data.

Thanks for your answer jreklund, but I guess pointing to my "products" in my JOIN is not the issue as I might have typed my codes here wrong Smile

My problem is, imagine that, 7 of my images on my database have 'gallery.imageproductid' = 4. It means, my product whose ID is 4 will show 7 images.
But with my codes, I can only fetch 1 result. I cannot fetch all the images for this join (article and images match).

Plus, I tried but couldn't figure out how to make a seperate SQL. How can I match the products with articles.. How can I join them on model-controller ?

As you can see, up to now, I have tried it ona a slug (link) based way.

Regards
Reply


Messages In This Thread
Get Images of an Article - by demyr - 09-16-2018, 06:07 AM
RE: Get Images of an Article - by jreklund - 09-16-2018, 09:46 AM
RE: Get Images of an Article - by demyr - 09-16-2018, 10:45 PM
RE: Get Images of an Article - by php_rocs - 09-17-2018, 07:49 AM
RE: Get Images of an Article - by Wouter60 - 09-17-2018, 08:42 AM
RE: Get Images of an Article - by demyr - 09-27-2018, 12:47 AM
RE: Get Images of an Article - by Pertti - 09-27-2018, 01:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB