I want to get product thumbnails on a product category page, each product 1st thumbnail image needs to be shown. right now the last image is showing. here is the screen shot for my db structure
EDIT:
right now the table format as screenshot, there are 4 images with order 1,2,3,4 i want to get the image with img_order 1.
when i am running sql query
SELECT i.img_order,p.*, i.product_id, i.dirName, i.img FROM products p inner JOIN product_images i ON i.product_id = p.id WHERE p.status = 1 and i.product_id=329 AND i.type = 'Static' GROUP BY i.product_id ORDER BY i.img_order asc
it's giving wrong result see screenshot
but i want to get the image with img_order 1.