well i found my answer here:
Thanks anyways :)
But got a solve doubt & stuck on it.
I used to it to display product category name on product detail page. Now when i use the same on other page ie. all products page where all products are viewed there it doesn't show cat name. Only last cat name is shown from database.
Products(all products are here) & productcategories (category names are here)
Have attached two files. product-detail is particular product page & other page is all products page where i have used repeat region to show all products which within has categoryname in it. But as said doesnt show right category name