having catname and catid in one table
having catid productid productname productimagepath in other table

now i want the catname to display on the top od the displaying dats images
my dats are viewed properly but how to display the catname there
i am having 4 categories
$heading=mysql_query("select cat_name from nikki.product_cat where nikki.product_cat.cat_id=".$catid,$con);

how to display