如何针对其消息显示评论

时间:2013-05-01 08:08:58

标签: php mysql

请在这里帮助我一些人如何显示适合该消息的评论 我有一个系统,人们可以发布消息,其他人可以评论墙壁。我正在使用MYSQL我有两个表,一个名为CHART,其中一个名为CHART,其中一个名为COMMENTS,其中评论为

<?php
   $profile= htmlentities($_SESSION['user']['username'], ENT_QUOTES, 'UTF-8');
   $reply_acc= htmlentities($_SESSION['user']['id'], ENT_QUOTES, 'UTF-8');
   $result = mysqli_query($con, "SELECT * FROM chart ORDER by chart_date DESC");
   while($row = mysqli_fetch_array($result))
   {
      echo("
      <hr color='#DDDDDD' size='1px' width='725px' align='right'>
      <table id='table' cellpadding='0' cellspacing='0' border='0'>
      <tr>
      ");

      echo("
      <td>
      <div class='tablet1'>
      <img src='users/wKzxVIyhLs6.png' width='80px' height='60px' border='0'>
      </div>
      ");

      echo("
      <div class='tablet2'>
       <div  class='user_msg_name'>
       ");

       echo("$row[chart_name]");
       echo nl2br (" 
            </div>
           <div class='user_msg_status'>
           $row[chart_msg]
           </div>
       ");

       echo("
           <div class='user_msg_links'>
           Like . Comments. <font style='float:right;'>$row[chart_via] | $row[chart_time]</font>
           </div>
           <div class='msg_comments'>
           <img src='images/contactpic.png' width='30px' height='30px' border='0' align='texttop'>
       ");

       echo("$profile &nbsp; $row[reply_msg] msg need");

       echo("
           <div class='user_msg_info'>
           Like . via . $row[date]
           </div>
           </div>
       ");

       echo("
           <div class='comment_from'>
           <form action='drop_comment.php' method='post'>
       ");

       echo (" <font class='my_comment'>$profile</font>");

       echo("
           <input type='text' name='reply_msg' placeholder='drop a comment...' value='' class='add_hook'>
           <input name='reply_date' type='hidden'  value='$row[chart_date]'>
           <input name='reply_id' type='hidden'  value='$reply_acc'>
           <input name='reply_via' type='hidden'  value='$device'>
           </form>
           </div>
            </div>
            </td>
            </tr>
            </table>
        ");
   }
?>

我的代码的问题是显示与消息分开的注释,例如那些也是消息

0 个答案:

没有答案