我得到了这个HTML
<div class="V_CPp">
<span class="ViewC">View more comments</span>
</div>
<div class="hov_c">
<div class="CommentsAwp Comment_Hs CA">
<img src="../users/<?php echo $CommenterPicture[0];?>">
<span><?php echo $CommenterName[0]; ?></span>
<span class="s2"><?php echo $CommentRow[1]; ?></span>
</div>
</div>这个Jquery/AJAX
$(".V_CPp").click(function(event) {
var numItems = $(this).siblings('.F_W_comments').children().children().length;
var i=$(this).siblings(".c_jq").children(".Likes").attr("data-i");
$.ajax({
url: '../connect.php',
type: 'GET',
cache: false,
contentType: false,
processData: false,
data:"VMC="+i+"&NI="+numItems,
success: function(data)
{
$("body").html(data);
}
});
});这个php(connect.php)
if (isset($_GET['VMC'])) {
$RandS=$_GET['VMC'];
$From=$_GET['NI'];
$To=$From+4;
$query=$con->query("SELECT id FROM uploads WHERE Rand='$RandS'");
$Id=$query->fetch_row();
$Commentsq=$con->query("SELECT * FROM (SELECT * FROM comments WHERE Post_id='$Id[0]' ORDER BY `DATE` DESC LIMIT $From,$To) AS sub ORDER BY `DATE` ASC");
while($COMM=$Commentsq->fetch_row())
{
echo $COMM[1]."<br />";
}
}所以当我有13条评论时,按从1到13的顺序,它只显示10-13,当我点击
<div class="V_CPp">它显示了从2到9的所有注释,而不是6-9
发布于 2016-06-05 23:18:04
您是否尝试过
<span class="s2"><?php echo $CommentRow[0]; ?></span>相反,
<span class="s2"><?php echo $CommentRow[1]; ?></span>请试着评论一下,也许这就是问题所在。
最幸运的是,
https://stackoverflow.com/questions/37643467
复制相似问题