I have some code
<?php
$sbq_cat=("select * from sbbleads_offer_cats where sb_ciduid=" . $sbrow_off["sb_uid"] );
//echo $sbq_cat;
$sbrs_cat=mysql_query($sbq_cat);
$sbcat_exists=false;
while($sbrow_cat=mysql_fetch_array($sbrs_cat))
{
$catpath="";
$cat_query=mysql_query("Select * from sbbleads_categories
where sb_id=".$sbrow_cat["sb_cid"] );
while ($rs=mysql_fetch_array($cat_query))
{
$catpath =" > <a href=\"cat_sell.php?cid=" . $rs["sb_id"] . "\">" .$rs["sb_cat_name"]."</a>".$catpath;
$cat_query=mysql_query("Select * from sbbleads_categories where sb_id=" . $rs["sb_pid"] );
}
echo '<a href="index.php">Home</a>'.$catpath.'<br>';
}
/* if(!$sbcat_exists)
echo $config["sb_null_char"]; //prints in case no other category than cid
*/ ?>
The problem I am facing with this code is that it prints duplicates like
Home > Agriculture > Agriculture & By-product Agents
Home > Agriculture > Agriculture & By-product Agents
Home > Agriculture > Agriculture Product Stocks
Home > Agriculture > Agriculture & By-product Agents
I want just single line telling "Home > Agriculture > Agriculture & By-product Agents" not multiple lines. Please let me know how could I do this.
Thanks