I have this PHP code I am trying to integrate with the html layout below it however I can not figure it out, the php code gets all status post and displays them in order but it then displays all comments that are associated with the status post so a status post could have 0 comments or it could have multiple comments.
If you read the notes I left in the PHP code and the notes I left in the html you will see the problem I am facing I need to put the comments inside the table cell of the status post somehow
Aşağıdaki resimde 1 durum sonrası ve bu yazı için 3 yorum var, ne yapmaya çalışıyorum yorumlar doğru statü yazılan altında sağ tarafta iç içe olacak orada kendi tabloda göstermek için olsun. Yani bu yazının altındaki bir tablo sınırı görmek üst @ durum yazı üzerine, bu sınır artık biraz daha mantıklı sonrası, umut için son yorumun altında olmalıdır
<?PHP
$last_id = 0;
echo '<table width="400">';
while ($row = mysql_fetch_array($res)) {
//start output of new status post and comments
if ($row['0'] != $last_id) {
echo 'status post stuff'
}
//start output of new status post and comments
//output comment here
$last_id = $row['0'];
if($row['commentid'] != ''){
echo 'status COMMENT for above status post'
}
//END output comment here
}
echo '</table>';
?>
<table width="400">
<!-- begin status post -->
<tr>
<td width="99" valign="top" style="border-bottom: 1px solid rgb(204, 204, 204); margin: 0px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px;"> <div class="imageSub" style="width: 90px;"> <img class="female" src="http://cache2.mycrib.net/images/image_group66/0/43/t_6871399b0962b5fb4e29ce477541e165950078.jpg" alt="Something" width="90"/> </div></td>
<td width="489" style="border-bottom: 1px solid rgb(204, 204, 204); margin: 0px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px;">so and so said blah blah blah @ wee hours of the moring! <BR>
<!-- begin comment -->
<table width="90%" style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px;">
<tr>
<td width="14%" rowspan="2" valign="top"><img class="male" src="http://cache2.mycrib.net/images/image_group34/0/39/T_653807517aff2b1f5662d865b40d87d527c8eb.jpg" alt="Something" width="45"/></td>
<td width="86%">Date Posted</td>
</tr>
<tr>
<td>Comment text</td>
</tr>
</table>
<!-- end comment -->
</td>
</tr>
<!-- end status post -->
</table>