moodle - How to implement a next button for a forum in php? -


currently trying implement next button take next topic in forum have no idea start.

assuming forum updated in terms of time of last post.

if have autoincrementing primary key in database, current id, bump , create link pointing next 1 (provided quick check make sure valid, e.g., next post wasn't deleted previously).

edit: if forums sorted last update (and want "next" post mean next updated, you'll need little querying.

$sql = "select postid, postname forum_posts last_updated < '$thispostslastupdate' order last_updated desc limit 1"; $result = mysqli_query( $dbconn , $sql ); $fetch = $result->fetch_array(); 

$fetch should contain array of values want (the id generating link next post , postname link's text).


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -