Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wp-statistics domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/wordpress/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wp-pagenavi domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/wordpress/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wordpress-seo domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/wordpress/wp-includes/functions.php on line 6114
Pagination tableau PHP - Plessy

Pagination tableau PHP

<?php

$rowperpage = 10;
$row1 = 0;

// Previous Button
if(isset($_POST['but_prev'])){
        $row1 = $_POST['row1'];
        $row1 -= $rowperpage;
        if( $row1 < 0 ){
                $row1 = 0;
        }
}

// Next Button
if(isset($_POST['but_next'])){
        $row1 = $_POST['row1'];
        $allcount = $_POST['allcount'];
        $val = $row1 + $rowperpage;
        if( $val < $allcount ){
                $row1 = $val;
        }
}

$sql = "SELECT COUNT(*) AS cntrows FROM table";
$result = mysqli_query($conn,$sql);
$fetchresult = mysqli_fetch_array($result);
$allcount = $fetchresult['cntrows'];

$sql = "SELECT * FROM table";
$result = mysqli_query($conn, $sql);
?>

</br>

<div class="table-responsive">
        <table id="myTable" class="table table-striped">
                <tr>
                        <th>Nom</th>
                        <th>Email</th>
                </tr>
                <?php
                        if(mysqli_num_rows($result) > 0) {
                                while($row = mysqli_fetch_array($result)) {
                ?>
                <tr>
                        <td><?php echo $row["nom"];?></td>
                        <td><?php echo $row["email"];?></td>
                </tr>
                <?php
                                }
                        }
                ?>
        </table>
</div>
<form method="post" action="">
            <div id="div_pagination">
                <input type="hidden" name="row1" value="<?php echo $row1; ?>">
                <input type="hidden" name="allcount" value="<?php echo $allcount; ?>">
                <input type="submit" class="button" name="but_prev" value="Previous">
                <input type="submit" class="button" name="but_next" value="Next">
            </div>
</form>