Below is the code that not returning anything but echoing values; it should return 'something' on false of if($return['status']=='Active')
function product($ids)
{
$return = mysql_fetch_array(mysql_query("select * from tbl_product where id = $ids"));
if($return['category_id'])
$recursive_return = recursive($return['category_id']);
$recursive_return;
}
function recursive($category_id)
{
$return = mysql_fetch_array(mysql_query("select * from tbl_main_category where id = $category_id"));
if($return['status']=='Active')
recursive($return['parentId']);
else
$rr = 'something';
return $rr;
}
$return = product(1049);
echo $return;