All pastes #587636 Raw Edit

Mine

public php v1 · immutable
#587636 ·published 2007-06-24 19:12 UTC
rendered paste body
<?phpfunction ifChildComm($commid) {   $sql = "SELECT COUNT(commid) FROM comments WHERE parent='$commid'";   $childCount = mysql_fetch_array(mysql_query($sql));   if ($childCount != 0) {      return TRUE; }   else {      return FALSE; }}function commentDisp($row, $level) {   $userid = $row["userid"];   $sql = "SELECT username FROM users WHERE userid='$userid'";   $username = mysql_fetch_array(mysql_query($sql));   ?>   <div style="margin-right: 50px; height: 15px; background-color: #C9C9C9;      margin-top: 15px; margin-left: <?php echo 300 + 50 * $level; ?>px; padding: 5px;">   <p style="color: #444444; font-size: .75em;">   Posted by: <a href="/profile/viewprofile.php?userid=<?php echo $userid; ?>">      <?php echo $username["username"]; ?></a>   |   Posted on: <?php echo $row["timestamp"]; ?>   </p></div>   <div style="border: 1px solid #C9C9C9; margin: 0px; margin-right: 50px;      margin-left: <?php echo 300 + 50 * $level; ?>px; padding: 5px;">   <p style="font-size: .75em;"><?php echo $row["body"]; ?></p></div><?php}echo "<p style=\"margin-top: 30px; margin-left: 300px;        font-weight: bold; text-decoration: underline;\">        Discussion &amp; Critique</p>";$sql = "SELECT commid,userid,body,timestamp FROM comments WHERE propid='$propid' AND parent='0'";$commQuery = mysql_query($sql);while ($row = mysql_fetch_array($commQuery)) {   commentDisp($row, 0);   $commid = $row["commid"];   $sql = "SELECT commid,userid,body,timestamp FROM comments WHERE parent='$commid'";   $subCommQuery = mysql_query($sql);   while ($row = mysql_fetch_array($subCommQuery)) {      commentDisp($row, 1);   }}?>