Hi guys. I'm trying to validate some code, but getting ID already defined errors...which I 'm expecting as the code loops through a record set and re-uses the DIV id.
The question is how would you get round this? I thought about adding a simple variable +1 to the ID name as it loops, but it seems a bit of a fudge really...
Any suggestions? Thx in advance
<?
while($row = mysql_fetch_array($result)){
if($row['depth']<1){
echo "<h1>Buy ".$row['name']."</h1>";
echo "<div id=\"buy_detail_sub\">";
if(check_language_desc(stripslashes($row[$desc_lang]))){
// we do have a description for this language...
echo stripslashes($row[$desc_lang]);
} else {
//we don't have a description, so default to english
echo stripslashes($row['description']);
}
echo "</div>";
} else {
if($toggle){
echo "<div id=\"buy_detail_sub_header_l\">
<a href=\"/buy/".$row['category_url']."/\">$row[0]</a>
</div>";
$toggle = 0;
} else {
echo "<div id=\"buy_detail_sub_header_r\">
<a href=\"/buy/".$row['category_url']."/\">$row[0]</a>
</div>";
$toggle = 1;
}
}
}
?>