$query = "SELECT * FROM filipinacelebs ORDER BY title ASC";
$result = mysql_query($query) or die("Query failed");
$nrows = mysql_num_rows($result);
$brows = $nrows;
$tds = 2;
$items = $brows/$tds;
echo "
";
$j = 1;
$n = 1;
while($j <= $tds){
echo "";
$i = 1;
while($i <= $items && $n <= $brows)
{
$row = mysql_fetch_array($result);
extract($row);
$link = strtolower($title);
$link = str_replace(" ", "_", $link);
echo "".$title."";
echo " ";
$i = $i + 1;
$n = $n + 1;
} // end while
if ($i == $items && $i <= $brows) {
echo " | ";
}
$j = $j + 1;
} // end while
echo "
";
?>