Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author WillBontrager

    (@willbontrager)

    I guess it depends on how you implement it, but probably not.

    This page contains information about it’s limitations and other things you may want to know.

    https://www.willmaster.com/software/WPplugins/insert-php-wordpress-plugin-instructions.php

    Will

    Thread Starter ndmccain

    (@ndmccain)

    The code looks like:

    <?php if (isset($_GET["page"])) { $page  = $_GET["page"]; } else { $page=1; };
    $start_from = ($page-1) * 20;
    $sql = "SELECT * FROM users ORDER BY userid ASC LIMIT $start_from, 20";
    $rs_result = mysqli_query($conn,$sql);
    ?>
    <table class="table table-striped" width="100%">
    <?php
    while ($row = mysqli_fetch_array($rs_result)) {
    ?>
                <tr>
                <td><a href="viewmember.php?mid=<? echo $row['userid']; ?>"><? echo $row['username']; ?></a></td>
                <td><a class="btn btn-default btn-xs" href="mailto:<? echo $row['email']; ?>"><i class="fa fa-envelope"></i> Email</a></td>
                <td><? echo $row['level']; ?> Member</td>
                <td><? echo $row['joined']; ?></td>
                </tr>
    <?php
    };
    ?>
    </table>
    <?php
    $sql2 = "SELECT COUNT(userid) FROM users";
    $rs_result2 = mysqli_query($conn,$sql2);
    $row2 = mysqli_fetch_row($rs_result2);
    $total_records = $row2[0];
    $total_pages = ceil($total_records / 20);
      echo '<nav><ul class="pagination pagination-sm">';
    for ($i=1; $i<=$total_pages; $i++) {
                echo "<li><a href='/members/?page=".$i."'>".$i."</a></li> ";
    };
    echo '</ul></nav>';

    It would of course be edited to work with the plugin and the paths to the db connection file would be added.

    Thank you for your time!

    Plugin Author WillBontrager

    (@willbontrager)

    I apologize, but reworking your code to see if it would work in Insert PHP would be considered custom programming. And custom programming is something we charge for.

    Insert PHP is free to use. Go ahead and give it a try.

    Will

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Pagination?’ is closed to new replies.