i would like to achieve full list of a table and two different name from another table where first table two id is matched with another two table. here is my query:
$sql =
"select
ls.id, ls.cat_id, ls.sub_id, rs.cat_name, lh.sub_cat_name,
ls.prod_name, ls.price, ls.availability, ls.description, ls.img_1,
ls.img_2, ls.img_3,ls.img_4, ls.img_5, ls.img_6, ls.img_7, ls.img_8,
ls.img_9, ls.img_10, ls.prod_order, ls.type
from product as ls
left join category as rs on rs.id = ls.cat_id
left join subcategory as lh on lh.id = ls.sub_id
where ls.id ='".$pid."'";
So the query is working fine. so my question is can this be normalize to be more short query in length?