The title shows what I need to accomplish but what I'm getting as the page builds is 3 columns with the same result on each row. Each row is different but each column on each row has the same thing repeated instead of different things for column one, two, and three.
I'm missing something in the code below to make this work, any help would be greatly appreciated.
Thank you.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$results = mysql_query("SELECT title,link FROM syndicate ORDER BY popularity DESC LIMIT 75");
while ($row = mysql_fetch_array($results)){
$title = $row['title'];
$link = $row['link'];
if ($divtest = 1){
//insert in div col1;
echo '<div class="col1">';
///<!-- Column 1 start -->
echo '<a href="' . $link . '" target="_blank">' . $title . '</a><br><br>'; /// add all links here
///<!-- Column 1 end -->
echo '</div>';
$divtest = 2;
}
if ($divtest = 2){
//insert in div col2;
echo '<div class="col2">';
///<!-- Column 2 start -->
echo '<a href="' . $link . '" target="_blank">' . $title . '</a><br><br>'; /// add all links here
///<!-- Column 2 end -->
echo '</div>';
$divtest = 3;
}
if ($divtest = 3){
//else {
//insert in div col3;
echo '<div class="col3">';
///<!-- Column 3 start -->
echo '<a href="' . $link . '" target="_blank">' . $title . '</a><br><br>'; /// add all links here
///<!-- Column 3 end -->
echo '</div>';
$divtest = 1;
}
}