here's my code:
Code: Select all
$news2 = $row['news'];
include('includes/head.php');
$date = date('Y-m-d H:i:s');
mysql_select_db("news", $con);
$result = mysql_query("SELECT * FROM news ORDER BY date DESC LIMIT 10");
while($row = mysql_fetch_array($result))
{
if ( $row['cat'] == News){
echo " <table bgcolor=\"#FFF7CA\" width=\"500\" height=\"100\" cellpadding=\"0\" cellspacing=\"0\" style=\"border: 1px solid #FFD460; margin: 10px; padding: 0;\" >
<tr>
<td valign=\"top\" height=\"15\" style=\"padding: 3px 3px 3px 5px ; border-bottom: 1px solid #FFD460\">
<d1head> News: " . $row['title'] . "</d1head>
</td>
</tr>
<tr>
<td valign=\"top\" height=\"20\" style=\"padding: 10px\"
<t2> " . substr($news2,0,10) ." </t2><t2><br />
<br /> " . $row['name'] . "</t2>
</td>
</tr>
<tr>
<td valign=\"top\" height=\"20\" style=\"border-top: 1px solid #FFD460\">
<t2>" . $row['date'] . "</t2>
</td>
</tr>
</table>
";
}
else{}
}