Hi
Im a newbe and im not the best on programing php but i built this and i hop if some one can help me clean up or all the unusless code i put up..
i know that my way is not the best but it works ut it's not clena i can say..
<?php
include ("../Management/mysqlcondbfm.php");
$maintopic_query = mysql_query("SELECT * FROM maintopics ORDER BY ID") or die (mysql_error());
while ($maintopicresult = mysql_fetch_array($maintopic_query)) {
$getmaintopicID = $maintopicresult['ID'];
?>
___________________________________________________________
<br>
<table width="357" cellpadding="1">
<tr>
<td width="220"><a href="child-topicview.php?maintopicID=<?php echo $maintopicresult['ID'] ?>"><?php echo $maintopicresult['maintopicname'] ?></a></td>
<td width="90"><h3 class="forumposticon"> Posted by:<br><center><?
$result = mysql_query("SELECT username, postorderstamp FROM mainposts where maintopicID='$getmaintopicID' ORDER BY postorderstamp DESC LIMIT 1");
if (mysql_num_rows($result) == 0) {
echo "No Topics";
} else {
$row = mysql_fetch_assoc($result);
?>
<a href="/management/usersigt.php?usernameID=<?php
echo $row['username'];
}
?>"><? echo $row['username'];?></a></center></td>
<td width="90"><h3 class="forumposticon"> Posted by:<br><center><a href="/management/usersigt.php?usernameID=<?php
$replayposterID = $maintopicresult['username'];
$usernameID_query = ("SELECT * FROM reg_info WHERE username='$replayposterID'");
include ("../Management/mysqlcondbrr.php");
$gotousernameID_query = mysql_query($usernameID_query, $starta) or die (mysql_error());
$gotousernameID = mysql_fetch_array($gotousernameID_query);
echo $gotousernameID['regid'] ?>"><?php echo $maintopicresult['username']; ?></a></center></td>
</tr>
<tr>
<?php include ("../Management/mysqlcondbfm.php"); ?>
<td width="190"><FONT SIZE="-2"></FONT><b><?php echo $maintopicresult['maintopicdescription'];?></b></font></td>
<td width="80"><h3 class="posttimeicon"> Post time:<br><center><?php echo $row['postorderstamp'];?></center></td>
<td width="80"><h3 class="posttimeicon"> Post time:<br><center><?php echo $maintopicresult['maintopicorderstamp'];?></center></td>
</tr>
<tr>
<td width="190"><FONT SIZE="-2"></FONT><b></b></font></td>
<td width="80"><h3 class="forumtotalposticon"> Total Post:<br><center><? $result = mysql_query("SELECT COUNT(*) FROM mainposts where maintopicID='$getmaintopicID'");
echo mysql_result($result, 0);?></center></td>
<td width="90"><h3 class="forumtotalthredicon"> Total Threds:<br><center><? $result = mysql_query("SELECT COUNT(*) FROM childtopics where maintopicID='$getmaintopicID'");
echo mysql_result($result, 0);?></center></td>
</tr>
<tr>
<td width="190"></td>
<td width="75">
<form action="delete-maintopic.php?maintopicID=<?php echo $maintopicresult['ID'] ?>" method="POST" style="margin:1px; float: right;">
<INPUT TYPE="hidden" name="action" value="delete_two">
<input type="submit" class="button" style="width: 90px; height: 20px;" align="center" value="Delete maintopic"></td>
</form >
<td width="75"><form action="edit-maintopic.php?maintopicID=<?php echo $maintopicresult['ID'] ?>" method="POST" style="margin:1px; float: right;">
<INPUT TYPE="hidden" name="action2" value="edit_two">
<input type="submit" class="button" style="width: 90px; height: 20px;" align="center" value="Edit maintopic"></td>
</form >
</tr></table>
<?php
}
if (mysql_num_rows($maintopic_query) < 1) {
?>
<TR height=300>
<TD WIDTH=100% BGCOLOR="#FFFFFF" HEIGHT=28 VALIGN=TOP>
<CENTER>
<BR><B>There Are No Topics</B><BR><BR>
</TD>
</TR>
<?php }
?>