Hi there,
I've made this page in html:
http://www.greenbeanbaby.com/retailers.php
with drop-down menus that work.
But when I try to make it dynamic for my client to update it, I'm stuck! The drop downs don't work.
Here is the code I'm using:
$r=mysql_query("SELECT * FROM retailer");
$varloop=1;
echo "<div id='wrap'>";
while(list($idr, $name)=mysql_fetch_array($r)){
//echo "$name";
//echo "<br />";
$r2=mysql_query("SELECT idp, provinces FROM province WHERE parentidr='$idr'") or die(mysql_error());
while(list($idp, $provinces)=mysql_fetch_array($r2)){
echo ("<span class='product-menu'>");
echo "$provinces";
echo ("</span>");
echo ("<a href='#' id='example.$varloop.-show' class='showLink' onclick='showHide(example.$varloop);return false;'><img src='../images/retailer-down.gif' alt='retailer' width='10' height='8' class='img' /></a>");
echo ("<div id='example.$varloop' class='more'><a href='#' id='example.$varloop.-hide' class='hideLink' onclick='showHide(example.$varloop);return false;'><img src='../images/retailer-up.gif' alt='retailer' width='10' height='8' class='img' /></a>");
echo "<br />";
$varloop++;
//echo $varloop;
$r3=mysql_query("SELECT idc, cities FROM city WHERE parentidp='$idp'") or die(mysql_error());
while(list($idc, $cities)=mysql_fetch_array($r3)){
echo ("<span class='bold'>");
echo "$cities";
echo ("</span>");
echo "<br />";
$r4=mysql_query("SELECT ids, stores, website, link, phone FROM store WHERE parentidc='$idc' AND parentidp='$idp'") or die(mysql_error());
while(list($ids, $stores, $website, $link, $phone)=mysql_fetch_array($r4)){
echo "$stores";
echo " ";
echo ("<a href='$link' target='_blank' class='second'>");
echo "$website";
echo ("</a>");
echo " ";
echo "$phone";
echo "<br />";
}
}
echo ("</div>");
echo "<br /><br />";
}
}
echo "</div>";
Can someone help me find my mistake please?
Thank you!