mhunt
06-29-2007, 07:57 PM
My problem is that in the <em>Also found in:</em> section it is only displaying the results for the first entry and not the rest
any idea what would cause this to happen?
<?
$result = $db->query("SELECT * FROM business_detail");
$result2 = $db->query("SELECT * FROM business_type");
while($row = $db->fetchArray($result)) {
?>
<? if($row['b_image']) { ?><img src="../images/thumb_b/<? echo $row['b_image']; ?>" /><br /><? } ?>
<strong>Title:</strong> <? echo $row['b_title']; ?> <br />
<strong>Address:</strong> <? echo $row['b_address1']; ?><br /><? if($row['b_address2']) { echo $row['b_address2']."<br />"; } ?>
<strong>Phone:</strong> <? echo $row['b_phone']; ?><br />
<strong>Fax:</strong> <? if($row['b_fax'] == "") { echo "n/a"; } else { echo $row['b_fax']; } ?><br />
<strong>Email:</strong> <? echo $row['b_email']; ?><br />
<strong>Website:</strong> <? if($row['b_weburl'] == "n/a") { echo $row['b_weburl']; } else {?><a href="<? echo $row['b_weburl']; ?>"><? echo $row['b_weburl']; ?><a><? } ?><br />
<strong>Description:</strong><br /> <? echo $row['b_desc']; ?><br />
<em>Also found in:</em> <br />
<?
$types = preg_split("/[\-,]+/", $row['b_types']);
while($row2 = $db->fetchArray($result2)) {
//$types = str_replace("-", " ", $row['b_types']);
if(in_array($row2['t_short'], $types)) { echo $row2['t_name']."<br /> "; }
}
any idea what would cause this to happen?
<?
$result = $db->query("SELECT * FROM business_detail");
$result2 = $db->query("SELECT * FROM business_type");
while($row = $db->fetchArray($result)) {
?>
<? if($row['b_image']) { ?><img src="../images/thumb_b/<? echo $row['b_image']; ?>" /><br /><? } ?>
<strong>Title:</strong> <? echo $row['b_title']; ?> <br />
<strong>Address:</strong> <? echo $row['b_address1']; ?><br /><? if($row['b_address2']) { echo $row['b_address2']."<br />"; } ?>
<strong>Phone:</strong> <? echo $row['b_phone']; ?><br />
<strong>Fax:</strong> <? if($row['b_fax'] == "") { echo "n/a"; } else { echo $row['b_fax']; } ?><br />
<strong>Email:</strong> <? echo $row['b_email']; ?><br />
<strong>Website:</strong> <? if($row['b_weburl'] == "n/a") { echo $row['b_weburl']; } else {?><a href="<? echo $row['b_weburl']; ?>"><? echo $row['b_weburl']; ?><a><? } ?><br />
<strong>Description:</strong><br /> <? echo $row['b_desc']; ?><br />
<em>Also found in:</em> <br />
<?
$types = preg_split("/[\-,]+/", $row['b_types']);
while($row2 = $db->fetchArray($result2)) {
//$types = str_replace("-", " ", $row['b_types']);
if(in_array($row2['t_short'], $types)) { echo $row2['t_name']."<br /> "; }
}