// Start a query ...
$query = "SELECT * FROM banners_website WHERE position =\"left\" ORDER BY id";
// run the query and show the results
displayBanners($connection, $query,'');
?>

//sponsors
if (!($result = @ mysql_query ("SELECT * FROM sponsors WHERE type ='sponsor' ORDER BY id ", $connection)))
showerror();
$rowsFound = @ mysql_num_rows($result);
if($rowsFound!=0){
$i = 0;
?>
while ($row = @ mysql_fetch_array($result)) { ?>
$i = $i+1;
$r = fmod($i, 3);
if($i<3){ ?>
}
else if($r!=0){ ?>
}else{ ?>
} }?>
} ?>

//affiliates
if (!($result = @ mysql_query ("SELECT * FROM sponsors WHERE type ='affiliate' ORDER BY id ", $connection)))
showerror();
$rowsFound = @ mysql_num_rows($result);
if($rowsFound!=0){
$i = 0;
?>
while ($row = @ mysql_fetch_array($result)) { ?>
$i = $i+1;
$r = fmod($i, 3);
if($i<3){ ?>
}
else if($r!=0){ ?>
}else{ ?>
} }?>
} ?>
// Start a query ...
$query = "SELECT * FROM banners_website WHERE position =\"right\" ORDER BY id";
// run the query and show the results
displayBanners($connection, $query,'');
?>