problem with mysql while loop
Posted: Fri Jan 13, 2006 12:08 pm
Hi there,
The first while loop is working fine, however the second one does not work.
Can anyone see a problem??
Any ideas would be great, thanks
Will
The first while loop is working fine, however the second one does not work.
Can anyone see a problem??
Code: Select all
$query = "SELECT * from company_ins, company_log WHERE company_ins.ins_id = '$typeid'
AND company_log.Id = company_ins.company_Id order by company_log.name";
$result = mysql_query($query, $conn);
//check for any featured providers
while ($row = mysql_fetch_array($result, $conn)) {
if ($row['type_featured'] == "f") {
?>
<div class="linkbox">
FEATURED<a href="<?php echo $row['link']; ?>" class="link" target="_blank"><strong><?php echo $row['name']; ?></strong></a>
<p><?php echo $row['description']; ?><p><a href="<?php echo $row['link']; ?>" target="_blank"><?php echo $row['link']; ?></a></p>
</div>
<?php
}
}
while ($row = mysql_fetch_array($result, $conn)) {
if ($row['type_featured'] !='f') {
?>
<div class="linkbox">
<a href="<?php echo $row['link']; ?>" class="link" target="_blank"><strong><?php echo $row['name']; ?></strong></a>
<p><?php echo $row['description']; ?><p><a href="<?php echo $row['link']; ?>" target="_blank"><?php echo $row['link']; ?></a></p>
</div>
<?php
}
}
?>Any ideas would be great, thanks
Will