I'm trying to display the first row in one color and the second row in another color but my code displays the result twice in both colors for example lets say I have 5 results my code will double the results by displaying 10 results. How can I fix this problem?
Here is the php code.
while ($row = mysqli_fetch_assoc($dbc)) {
//first row
echo '<h3 class="title"><a href="#" title="">' . $row['title'] .'</a></h3>';
echo '<div class="summary"><a href="#" title="">' . substr($row['content'],0,255) . '</a></div>';
//second row
echo '<h3 class="title-2"><a href="#" title="">' . $row['title'] .'</a></h3>';
echo '<div class="summary-2"><a href="#" title="">' . substr($row['content'],0,255) . '</a></div>';
}