e.g
select id,product from products;
id product
1  iPhone 6 
2  Dell Inspiron
pid is foreign key referencing to product id in products
select * from product_image;
id pid image
1  1   he7gu8h9d54w.jpg
2  2   jgeywfyu3r34.jpg
3  1   drtsw54e452r.jpg
4  2   weyr63tr236r.jpg
after joining, i am getting this..
id product       img_id pid image
1  iPhone 6      1      1   he7gu8h9d54w.jpg
1  iPhone 6      3      1   drtsw54e452r.jpg
2  Dell Inspiron 2      2   jgeywfyu3r34.jpg
2  Dell Inspiron 4      1   drtsw54e452r.jpg
I'm getting multiple rows from product_image with respect to one id in product table I want to get one row from product_image with respect to a product_id...plz help..
i want this...
id product       img_id pid image
1  iPhone 6      1      1   he7gu8h9d54w.jpg
2  Dell Inspiron 4      1   drtsw54e452r.jpg