I have three set of datas retrieved from my db and i want to show first two of them in a row in a table(date and subject) and the content(the third one) in next row with colspan 2.How should i do that
$conn = mysql_connect($host,$user,$pass) or die (mysql_errno().": ".mysql_error()."<BR>");
mysql_select_db($dbname);
$request = "select * from news";
$results = mysql_query($request,$conn);
$count=mysql_num_rows($results);
$rows = mysql_fetch_assoc($results);
echo'<table cellpadding=2 cellspacing=5 border=0 width=95%>';
for($i = 0; $i < $count; $i++) {
$rows = mysql_fetch_assoc($results);
if($i % 2) {
echo "<TR bgcolor=\"#f0f8ff\">\n";
} else {
echo "<TR bgcolor=\"#faebd7\">\n";
}
echo'<td>',$rows['sub'],'</td><td>',$rows['ndate'],'</td>';
echo'<td colspan=2>',$rows['cont'],'</td>';
echo'</tr>';
}
echo'</table>';
With the above code i can only display all three set of datas in a single row ... What should i do ... please help