I have got this 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>
And this 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);
}
});
});
And this 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 />";
}
}
So when i have lets say 13 comments in order from 1 to 13 It only shows 10-13 and when i click
<div class="V_CPp">
It shows me all comments from 2 to 9 instead of 6-9
Did you try with
<span class="s2"><?php echo $CommentRow[0]; ?></span>
instead
<span class="s2"><?php echo $CommentRow[1]; ?></span>
Try and comment please, maybe this is the issue.
Best of lucks,