I'm trying to create a blog thing which displays comments stored inside a database: however I would like the comments to appear when the user scrolls down, dynamically creating it on the page, rather than having links to the next set of comments.
At the moment I am using MySQL with php to display the comments stored.
$query = "SELECT * FROM comment ORDER BY time DESC";
$result = mysql_query($query);
while($data = mysql_fetch_assoc($result)){
echo "<comment><div class='comment-bubble'><p>" . $data['comment'] . "</p></div>";
//other div structure & data here
}
I know there are plugins available like jscroll. But this fetches data from other HTML files rather than from a database.
I know the method may need changing as php loads the data before the page is ... so what would be the best way to go about this?
Thanks guys!