load comments when click to button
<p>I am developing PHP blog site for learning Perpose of PHP and JAVASCRIPT. Now i am doing work for comment on the post.here i have one problem.</p>

<pre><code>$('.comment_button').live("click",function() 
{ 
var ID = $(this).attr("id");
var comment= $("#ctextarea"+ID).val();
var dataString = 'comment='+ comment + '&amp;msg_id=' + ID;

if(comment=='')
{
alert("Please Enter Comment Text");
}
else
{
$.ajax({
type: "POST",
url: "comment_add.php",
data: dataString,
cache: false,
success: function(html){
$("#commentload"+ID).append(html);
$("#ctextarea"+ID).val('');
$("#ctextarea"+ID).focus();
 }
 });
}
return false;
});
$('.commentopen').live("click",function() 
{
var ID = $(this).attr("id");
$("#commentbox"+ID).slideToggle('slow');
return false;
}); 
</code></pre>

<p>i used this javascript code to add comment but the problem is when i loged from one pc then i commented using this code than the comments from other user dont show...means after clicking on comment i can only show my comment.....</p>

<p>My comment_add.php is</p>

<pre><code>$comment=htmlentities($comment);
$query = mysql_query("SELECT com_id,wall_msg FROM `wall_comment` WHERE u_id='$uid' and      wall_id='$msg_id' order by com_id desc limit 1 ") or die(mysql_error());
$result = mysql_fetch_array($query);
if ($comment!=$result['comment'])
{
$result2 = mysql_query("SELECT * FROM user_wall WHERE u_id=$uid");
 while($row = mysql_fetch_array($result2))
{
$u_name=$row['username'];
} 
$query = mysql_query("INSERT INTO `wall_comment` (wall_id,        wall_msg,wall_time,u_id,username) VALUES ('$msg_id', '$comment',now(),$uid,'$u_name')") or  die(mysql_error());
   $newquery = mysql_query("SELECT * FROM wall_comment  where wall_id='$msg_id' order  by com_id desc");
   $result = mysql_fetch_array($newquery);
   return $result;
  }     
</code></pre>
