Hi, i have the following code, but it doesn't output properly, as in it does 2 things for each section.
Can anybody help me?
Here is the code
any ideas??
Regards,
Martin
Computing Help And Info:
Can anybody help me?
Here is the code
Code:
<?php
include "../config.php";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
$q = mysql_query("SELECT `subDate` FROM news_computing ORDER BY `subDate` DESC");
while(list($subDate) = mysql_fetch_row($q)){
$h = date("H",$subDate)+6;
if($h == 24){
$h = "00";
}
$mnth = date("F",$subDate);
$subDate = date("D, M jS, Y $h:i",$subDate);
?>
<table width="100%" cellpadding="0" cellspacing="0" class="tableBG" align="center" border="1" bordercolor="#CCCCCC" style="border-collapse: collapse">
<tr class="tableBGtitleRow">
<td background="assets/navTitleRowContentMid.png"><strong>News for <?php echo $mnth; ?></strong><small></small></td>
</tr>
<tr>
<td style="padding:0px 5px 0px 5px; " align="center"><br />
<table width="90%" cellpadding="0" cellspacing="0" class="tableBG" border="1" bordercolor="#CCCCCC" style="border-collapse: collapse">
<tr>
<td width="40%">News Article</td>
<td width="20%">Submitted By</td>
<td width="30%">Submitted On</td>
</tr>
<?php
$q2 = mysql_query("SELECT `aid`, `newsTitle`, `subBy`, `subDate` FROM news_computing ORDER BY `subDate` DESC");
while(list($aid,$newsTitle,$subBy) = mysql_fetch_row($q2)){
?>
<tr>
<td><a href="/?p=compnews&aid=<?php echo $aid; ?>"><?php echo $newsTitle; ?></a></td>
<td><?php echo $subBy; ?></td>
<td><?php echo $subDate; ?></td>
</tr>
<?php
}
?>
</table><br />
</td>
</tr>
</table>
<br />
<?php
}
?>
</body>
</html>
Regards,
Martin
Computing Help And Info: