PHP & MySQL pagination display problem

xchuck

New Member
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\[code\]SELECT COUNT(comment_id) FROM comments WHERE id = $id\[/code\]The main query to display comments.\[code\]$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");\[/code\]The main querys reply comments.\[code\]//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");\[/code\]
 
Back
Top