How to create pagination after limiting an article words using substrin formula?

Viewed 32
        `<?php
        include 'partial/_dbconnect.php';

        $id = $_GET['postid'];
        $sql = "SELECT * FROM `posts` WHERE post_id=$id"; 
        $result = mysqli_query($conn, $sql);
        while($row = mysqli_fetch_assoc($result)){
            $title = $row['post_title'];
            $summary = $row['post_summary'];
            $note = $row['post_notes'];
            $time = $row['timestamp'];
            $post = $row['post_desc'];
            $like = $row['like_count'];                
        }
        ?>

        <!-- post section starts here -->
        <div class="container mb-0">
            <div class="jumbotron container mt-5 mb-3 py-3">
                <h1 class="display-4 post-font-heading text-danger"><?php echo $title;?></h1>
            </div>
        </div>
        <div class="container">
            <div class="jumbotron py-1">
                <p class="text-secondary mt-4"><b>Author: </b><i class="fa fa-user-circle" aria-hidden="true"
                        style="font-size: 15px; color: crimson; transition: color 0.3s ease;"></i><span
                        class="font-italic"> </span> | <b>Posted
                        On:</b> <?php echo timeAgo($time);?></p>
                <hr class="my-4">
                <p class="post-font-note text-justify">
                    <?php echo $note;?>
                </p>
                <p class="lead post-font-body text-justify mt-5" style="font-family: 'Caveat', cursive;">
                    <?php echo $post;?>
                </p>
                
            </div>
        </div>`

This is my code. in this, my $post contains more than 10k words and I want to make pagination dynamically for 500 words per page or 1000 words per page.

I'm using Bootstrap.

Please help!

0 Answers
Related