how to retrive category id from product id?

I’m in detail product page ( ex:- /index.php?dispatch=products.view&product_id=29778),

I can catch product id using $smarty.request.product_id, I want to get category id which related this product id.

Any idea to do this?



thanks

This is something I’m needing as well… if you have figured it out please post it, otherwise I’ll let you know what I figure out.

$category_data.category_id