When I set my pagination to display 10 comments at a time my comments query wont count the comments replies as part of the display count how can I fix this so that my comments replies are counted? My comments replies queries are nested in my main query to display comments.
Query for pagination
SELECT COUNT(comment_id) FROM comments WHERE id = $id
The main query to display comments.
$dbc = mysqli_query($mysqli,"SELECT comments.*, users.*
FROM comments
LEFT JOIN users
ON comments.user_id = users.user_id
WHERE id = '" . $id . "'
AND parent_comment_id = 0
LIMIT $start, $display");
The main querys reply comments.
//display comments replies
$dbc2 = mysqli_query($mysqli, "SELECT comments.*, users.*
FROM comments
LEFT JOIN users
ON comments.user_id = users.user_id
WHERE id = '" . $id . "'
AND parent_comment_id >= 1");
//display comments replies
$dbc3 = mysqli_query($mysqli, "SELECT comments.*, users.*
FROM comments
LEFT JOIN users
ON comments.user_id = users.user_id
WHERE id = '" . $id . "'
AND parent_comment_id >= 1");