I want pagination on the bottom, it is shown on the right side












0















The issue is that I am using pagination in my site, but pagination actually shows on footer. But in my site it is shown on right side on my page. Can you guys please help me?



You can see screenshot for better understanding.



enter image description here





Here is the code



<table class="table table-bordered">  
<thead>

<?php

if(isset($_GET['page'])){
$page = $_GET['page'];
}
else{
$page = 1;
}
if($page ==''||$page == 1){
$page1 = 0;
}
else{
$page1 = ($page*10)-10;
}
$sql = 'select * from divlink ORDER BY Name ASC Limit '.$page1.', 12';
$data = $connect->query($sql);

//print_r($data ->fetch_all());

while($row = mysqli_fetch_array($data)){
$image = $row['image'];
$Name = $row[0];
$Description = $row[1];
$Price = $row[2];
$ExpirtyDate = $row[3];
$Facebook = $row[4];
$Twitter = $row[5];
$Telegram = $row[6];
$Gmail = $row[7];
$Youtube = $row[8];
$Reddit = $row[9];
$Meduim = $row[10];
$Myetherwallet = $row[11];
$neowallet = $row[12];
$Bitcointalk = $row[13];
$divicon = $row[14];
$kyc = $row[15];
$id = $row['id'];
$Rating = $row[17];

//echo "<a href=''><div id='one' class='bordered' width='650px'><img src='{$Name}' class='imgss'/>{$Description}<p align='left'>{$id}</p><p align='right'>{$Price}</p><img src='{$Facebook}'width='20' height='20'><img src='{$Twitter}' width='20' height='20' align='right'/> <img src='{$Gmail}' width='20' height='20' align='right'/><img src='{$Youtube}' width='20' height='20' align='right'/><img src='{$Reddit}' width='20' height='20' align='right'/><img src='{$Meduim}' width='20' height='20' align='right'/><img src='{$Myetherwallet}' width='20' height='20' align='right'/><img src='{$neowallet}' width='20' height='20' align='right'/><img src='{$Bitcointalk}' width='20' height='20' align='right'/<img src='{$kyc}' width='20' height='20' align='right'/>1<div id='circle'></div></a><input type='button' value='Like' name='click' class = 'block'>";
echo "<a href=''><div id='one' class='bordered' width='650px'><img src='{$image}' class='imgss'/><p align='left'><center>{$Name}<br>{$Description}<br>{$Price}</center></p><p align='right'>{$ExpirtyDate}</p><center><img src='{$Rating}'/></center><br><img src='{$Facebook}'width='20' height='20'align='left'><img src='{$Twitter}' width='20' height='20' align='left'/> <img src='{$Gmail}' width='20' height='20' align='left'/><img src='{$Youtube}' width='20' height='20' align='left'/><img src='{$Reddit}' width='20' height='20' align='left'/><img src='{$Meduim}' width='20' height='20' align='left'/><img src='{$Myetherwallet}'width='20' height='20' align='left'/><img src='{$neowallet}'width='20' height='20' align='left'/><img src='{$Bitcointalk}' width='20' height='20' align='left'/<img src='{$kyc}' width='20' height='20' align='left'/>
<form method='post' action=''><input type='hidden' name='link_id' value='".$id."' /><input type='submit' name='like_button' value='Like' name='click' class = 'block'></form>

";



echo "</tr>";
echo"</div>";
echo'</td>';



}
?>
<?php
//pagination
$sql = 'select * from divlink';
$data = $connect->query($sql);
$record = $data->num_rows;
$records_pages = $record/12;
$records_pages = ceil($records_pages);
$prev = $page-1;
$next = $page+1;

echo'<ul class="pagination">';

if($prev >= 1) {

echo '<li><a href="?page='.$prev.'">prev</a></li>';
}


if($records_pages >=2){
for($r=1;$r<=$records_pages;$r++){
$active = $r == $page ? 'class ="active"' : '';
echo'<li><a href="?page='.$r.'">'.$r.'</a></li>';

}
}
if($next <= $records_pages && $records_pages >= 2) {

echo '<li><a href="?page='.$next.'">next</a></li>';
}
if($page != $records_pages && $records_pages >= 5){
echo '<li><a href="?page='.$records_pages.'">Last</a></li>';
}

echo '</ul>';


?>
</section>









share|improve this question

























  • Give the paginations cointainer 100% width?

    – getl0st
    Nov 25 '18 at 19:02











  • btw your script is vulnerable to sql injection

    – getl0st
    Nov 25 '18 at 19:06











  • can you please correct in my code if you think i am missing anything or anything goes wrong

    – Muhammad Sajid Lakha
    Nov 25 '18 at 19:17











  • You should google "avoid sql injection php"

    – getl0st
    Nov 25 '18 at 20:52
















0















The issue is that I am using pagination in my site, but pagination actually shows on footer. But in my site it is shown on right side on my page. Can you guys please help me?



You can see screenshot for better understanding.



enter image description here





Here is the code



<table class="table table-bordered">  
<thead>

<?php

if(isset($_GET['page'])){
$page = $_GET['page'];
}
else{
$page = 1;
}
if($page ==''||$page == 1){
$page1 = 0;
}
else{
$page1 = ($page*10)-10;
}
$sql = 'select * from divlink ORDER BY Name ASC Limit '.$page1.', 12';
$data = $connect->query($sql);

//print_r($data ->fetch_all());

while($row = mysqli_fetch_array($data)){
$image = $row['image'];
$Name = $row[0];
$Description = $row[1];
$Price = $row[2];
$ExpirtyDate = $row[3];
$Facebook = $row[4];
$Twitter = $row[5];
$Telegram = $row[6];
$Gmail = $row[7];
$Youtube = $row[8];
$Reddit = $row[9];
$Meduim = $row[10];
$Myetherwallet = $row[11];
$neowallet = $row[12];
$Bitcointalk = $row[13];
$divicon = $row[14];
$kyc = $row[15];
$id = $row['id'];
$Rating = $row[17];

//echo "<a href=''><div id='one' class='bordered' width='650px'><img src='{$Name}' class='imgss'/>{$Description}<p align='left'>{$id}</p><p align='right'>{$Price}</p><img src='{$Facebook}'width='20' height='20'><img src='{$Twitter}' width='20' height='20' align='right'/> <img src='{$Gmail}' width='20' height='20' align='right'/><img src='{$Youtube}' width='20' height='20' align='right'/><img src='{$Reddit}' width='20' height='20' align='right'/><img src='{$Meduim}' width='20' height='20' align='right'/><img src='{$Myetherwallet}' width='20' height='20' align='right'/><img src='{$neowallet}' width='20' height='20' align='right'/><img src='{$Bitcointalk}' width='20' height='20' align='right'/<img src='{$kyc}' width='20' height='20' align='right'/>1<div id='circle'></div></a><input type='button' value='Like' name='click' class = 'block'>";
echo "<a href=''><div id='one' class='bordered' width='650px'><img src='{$image}' class='imgss'/><p align='left'><center>{$Name}<br>{$Description}<br>{$Price}</center></p><p align='right'>{$ExpirtyDate}</p><center><img src='{$Rating}'/></center><br><img src='{$Facebook}'width='20' height='20'align='left'><img src='{$Twitter}' width='20' height='20' align='left'/> <img src='{$Gmail}' width='20' height='20' align='left'/><img src='{$Youtube}' width='20' height='20' align='left'/><img src='{$Reddit}' width='20' height='20' align='left'/><img src='{$Meduim}' width='20' height='20' align='left'/><img src='{$Myetherwallet}'width='20' height='20' align='left'/><img src='{$neowallet}'width='20' height='20' align='left'/><img src='{$Bitcointalk}' width='20' height='20' align='left'/<img src='{$kyc}' width='20' height='20' align='left'/>
<form method='post' action=''><input type='hidden' name='link_id' value='".$id."' /><input type='submit' name='like_button' value='Like' name='click' class = 'block'></form>

";



echo "</tr>";
echo"</div>";
echo'</td>';



}
?>
<?php
//pagination
$sql = 'select * from divlink';
$data = $connect->query($sql);
$record = $data->num_rows;
$records_pages = $record/12;
$records_pages = ceil($records_pages);
$prev = $page-1;
$next = $page+1;

echo'<ul class="pagination">';

if($prev >= 1) {

echo '<li><a href="?page='.$prev.'">prev</a></li>';
}


if($records_pages >=2){
for($r=1;$r<=$records_pages;$r++){
$active = $r == $page ? 'class ="active"' : '';
echo'<li><a href="?page='.$r.'">'.$r.'</a></li>';

}
}
if($next <= $records_pages && $records_pages >= 2) {

echo '<li><a href="?page='.$next.'">next</a></li>';
}
if($page != $records_pages && $records_pages >= 5){
echo '<li><a href="?page='.$records_pages.'">Last</a></li>';
}

echo '</ul>';


?>
</section>









share|improve this question

























  • Give the paginations cointainer 100% width?

    – getl0st
    Nov 25 '18 at 19:02











  • btw your script is vulnerable to sql injection

    – getl0st
    Nov 25 '18 at 19:06











  • can you please correct in my code if you think i am missing anything or anything goes wrong

    – Muhammad Sajid Lakha
    Nov 25 '18 at 19:17











  • You should google "avoid sql injection php"

    – getl0st
    Nov 25 '18 at 20:52














0












0








0








The issue is that I am using pagination in my site, but pagination actually shows on footer. But in my site it is shown on right side on my page. Can you guys please help me?



You can see screenshot for better understanding.



enter image description here





Here is the code



<table class="table table-bordered">  
<thead>

<?php

if(isset($_GET['page'])){
$page = $_GET['page'];
}
else{
$page = 1;
}
if($page ==''||$page == 1){
$page1 = 0;
}
else{
$page1 = ($page*10)-10;
}
$sql = 'select * from divlink ORDER BY Name ASC Limit '.$page1.', 12';
$data = $connect->query($sql);

//print_r($data ->fetch_all());

while($row = mysqli_fetch_array($data)){
$image = $row['image'];
$Name = $row[0];
$Description = $row[1];
$Price = $row[2];
$ExpirtyDate = $row[3];
$Facebook = $row[4];
$Twitter = $row[5];
$Telegram = $row[6];
$Gmail = $row[7];
$Youtube = $row[8];
$Reddit = $row[9];
$Meduim = $row[10];
$Myetherwallet = $row[11];
$neowallet = $row[12];
$Bitcointalk = $row[13];
$divicon = $row[14];
$kyc = $row[15];
$id = $row['id'];
$Rating = $row[17];

//echo "<a href=''><div id='one' class='bordered' width='650px'><img src='{$Name}' class='imgss'/>{$Description}<p align='left'>{$id}</p><p align='right'>{$Price}</p><img src='{$Facebook}'width='20' height='20'><img src='{$Twitter}' width='20' height='20' align='right'/> <img src='{$Gmail}' width='20' height='20' align='right'/><img src='{$Youtube}' width='20' height='20' align='right'/><img src='{$Reddit}' width='20' height='20' align='right'/><img src='{$Meduim}' width='20' height='20' align='right'/><img src='{$Myetherwallet}' width='20' height='20' align='right'/><img src='{$neowallet}' width='20' height='20' align='right'/><img src='{$Bitcointalk}' width='20' height='20' align='right'/<img src='{$kyc}' width='20' height='20' align='right'/>1<div id='circle'></div></a><input type='button' value='Like' name='click' class = 'block'>";
echo "<a href=''><div id='one' class='bordered' width='650px'><img src='{$image}' class='imgss'/><p align='left'><center>{$Name}<br>{$Description}<br>{$Price}</center></p><p align='right'>{$ExpirtyDate}</p><center><img src='{$Rating}'/></center><br><img src='{$Facebook}'width='20' height='20'align='left'><img src='{$Twitter}' width='20' height='20' align='left'/> <img src='{$Gmail}' width='20' height='20' align='left'/><img src='{$Youtube}' width='20' height='20' align='left'/><img src='{$Reddit}' width='20' height='20' align='left'/><img src='{$Meduim}' width='20' height='20' align='left'/><img src='{$Myetherwallet}'width='20' height='20' align='left'/><img src='{$neowallet}'width='20' height='20' align='left'/><img src='{$Bitcointalk}' width='20' height='20' align='left'/<img src='{$kyc}' width='20' height='20' align='left'/>
<form method='post' action=''><input type='hidden' name='link_id' value='".$id."' /><input type='submit' name='like_button' value='Like' name='click' class = 'block'></form>

";



echo "</tr>";
echo"</div>";
echo'</td>';



}
?>
<?php
//pagination
$sql = 'select * from divlink';
$data = $connect->query($sql);
$record = $data->num_rows;
$records_pages = $record/12;
$records_pages = ceil($records_pages);
$prev = $page-1;
$next = $page+1;

echo'<ul class="pagination">';

if($prev >= 1) {

echo '<li><a href="?page='.$prev.'">prev</a></li>';
}


if($records_pages >=2){
for($r=1;$r<=$records_pages;$r++){
$active = $r == $page ? 'class ="active"' : '';
echo'<li><a href="?page='.$r.'">'.$r.'</a></li>';

}
}
if($next <= $records_pages && $records_pages >= 2) {

echo '<li><a href="?page='.$next.'">next</a></li>';
}
if($page != $records_pages && $records_pages >= 5){
echo '<li><a href="?page='.$records_pages.'">Last</a></li>';
}

echo '</ul>';


?>
</section>









share|improve this question
















The issue is that I am using pagination in my site, but pagination actually shows on footer. But in my site it is shown on right side on my page. Can you guys please help me?



You can see screenshot for better understanding.



enter image description here





Here is the code



<table class="table table-bordered">  
<thead>

<?php

if(isset($_GET['page'])){
$page = $_GET['page'];
}
else{
$page = 1;
}
if($page ==''||$page == 1){
$page1 = 0;
}
else{
$page1 = ($page*10)-10;
}
$sql = 'select * from divlink ORDER BY Name ASC Limit '.$page1.', 12';
$data = $connect->query($sql);

//print_r($data ->fetch_all());

while($row = mysqli_fetch_array($data)){
$image = $row['image'];
$Name = $row[0];
$Description = $row[1];
$Price = $row[2];
$ExpirtyDate = $row[3];
$Facebook = $row[4];
$Twitter = $row[5];
$Telegram = $row[6];
$Gmail = $row[7];
$Youtube = $row[8];
$Reddit = $row[9];
$Meduim = $row[10];
$Myetherwallet = $row[11];
$neowallet = $row[12];
$Bitcointalk = $row[13];
$divicon = $row[14];
$kyc = $row[15];
$id = $row['id'];
$Rating = $row[17];

//echo "<a href=''><div id='one' class='bordered' width='650px'><img src='{$Name}' class='imgss'/>{$Description}<p align='left'>{$id}</p><p align='right'>{$Price}</p><img src='{$Facebook}'width='20' height='20'><img src='{$Twitter}' width='20' height='20' align='right'/> <img src='{$Gmail}' width='20' height='20' align='right'/><img src='{$Youtube}' width='20' height='20' align='right'/><img src='{$Reddit}' width='20' height='20' align='right'/><img src='{$Meduim}' width='20' height='20' align='right'/><img src='{$Myetherwallet}' width='20' height='20' align='right'/><img src='{$neowallet}' width='20' height='20' align='right'/><img src='{$Bitcointalk}' width='20' height='20' align='right'/<img src='{$kyc}' width='20' height='20' align='right'/>1<div id='circle'></div></a><input type='button' value='Like' name='click' class = 'block'>";
echo "<a href=''><div id='one' class='bordered' width='650px'><img src='{$image}' class='imgss'/><p align='left'><center>{$Name}<br>{$Description}<br>{$Price}</center></p><p align='right'>{$ExpirtyDate}</p><center><img src='{$Rating}'/></center><br><img src='{$Facebook}'width='20' height='20'align='left'><img src='{$Twitter}' width='20' height='20' align='left'/> <img src='{$Gmail}' width='20' height='20' align='left'/><img src='{$Youtube}' width='20' height='20' align='left'/><img src='{$Reddit}' width='20' height='20' align='left'/><img src='{$Meduim}' width='20' height='20' align='left'/><img src='{$Myetherwallet}'width='20' height='20' align='left'/><img src='{$neowallet}'width='20' height='20' align='left'/><img src='{$Bitcointalk}' width='20' height='20' align='left'/<img src='{$kyc}' width='20' height='20' align='left'/>
<form method='post' action=''><input type='hidden' name='link_id' value='".$id."' /><input type='submit' name='like_button' value='Like' name='click' class = 'block'></form>

";



echo "</tr>";
echo"</div>";
echo'</td>';



}
?>
<?php
//pagination
$sql = 'select * from divlink';
$data = $connect->query($sql);
$record = $data->num_rows;
$records_pages = $record/12;
$records_pages = ceil($records_pages);
$prev = $page-1;
$next = $page+1;

echo'<ul class="pagination">';

if($prev >= 1) {

echo '<li><a href="?page='.$prev.'">prev</a></li>';
}


if($records_pages >=2){
for($r=1;$r<=$records_pages;$r++){
$active = $r == $page ? 'class ="active"' : '';
echo'<li><a href="?page='.$r.'">'.$r.'</a></li>';

}
}
if($next <= $records_pages && $records_pages >= 2) {

echo '<li><a href="?page='.$next.'">next</a></li>';
}
if($page != $records_pages && $records_pages >= 5){
echo '<li><a href="?page='.$records_pages.'">Last</a></li>';
}

echo '</ul>';


?>
</section>






php mysql pagination question2answer






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 26 '18 at 1:01









Nic3500

3,33281829




3,33281829










asked Nov 25 '18 at 18:07









Muhammad Sajid LakhaMuhammad Sajid Lakha

16




16













  • Give the paginations cointainer 100% width?

    – getl0st
    Nov 25 '18 at 19:02











  • btw your script is vulnerable to sql injection

    – getl0st
    Nov 25 '18 at 19:06











  • can you please correct in my code if you think i am missing anything or anything goes wrong

    – Muhammad Sajid Lakha
    Nov 25 '18 at 19:17











  • You should google "avoid sql injection php"

    – getl0st
    Nov 25 '18 at 20:52



















  • Give the paginations cointainer 100% width?

    – getl0st
    Nov 25 '18 at 19:02











  • btw your script is vulnerable to sql injection

    – getl0st
    Nov 25 '18 at 19:06











  • can you please correct in my code if you think i am missing anything or anything goes wrong

    – Muhammad Sajid Lakha
    Nov 25 '18 at 19:17











  • You should google "avoid sql injection php"

    – getl0st
    Nov 25 '18 at 20:52

















Give the paginations cointainer 100% width?

– getl0st
Nov 25 '18 at 19:02





Give the paginations cointainer 100% width?

– getl0st
Nov 25 '18 at 19:02













btw your script is vulnerable to sql injection

– getl0st
Nov 25 '18 at 19:06





btw your script is vulnerable to sql injection

– getl0st
Nov 25 '18 at 19:06













can you please correct in my code if you think i am missing anything or anything goes wrong

– Muhammad Sajid Lakha
Nov 25 '18 at 19:17





can you please correct in my code if you think i am missing anything or anything goes wrong

– Muhammad Sajid Lakha
Nov 25 '18 at 19:17













You should google "avoid sql injection php"

– getl0st
Nov 25 '18 at 20:52





You should google "avoid sql injection php"

– getl0st
Nov 25 '18 at 20:52












1 Answer
1






active

oldest

votes


















0














Wrap the the boxes in a container like this:



<div class="container"> <a></a> <a></a> <a></a> </div>


And then under the div you can place your pagination



<div></div> <ul class="pagination"></ul>





share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53470389%2fi-want-pagination-on-the-bottom-it-is-shown-on-the-right-side%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Wrap the the boxes in a container like this:



    <div class="container"> <a></a> <a></a> <a></a> </div>


    And then under the div you can place your pagination



    <div></div> <ul class="pagination"></ul>





    share|improve this answer




























      0














      Wrap the the boxes in a container like this:



      <div class="container"> <a></a> <a></a> <a></a> </div>


      And then under the div you can place your pagination



      <div></div> <ul class="pagination"></ul>





      share|improve this answer


























        0












        0








        0







        Wrap the the boxes in a container like this:



        <div class="container"> <a></a> <a></a> <a></a> </div>


        And then under the div you can place your pagination



        <div></div> <ul class="pagination"></ul>





        share|improve this answer













        Wrap the the boxes in a container like this:



        <div class="container"> <a></a> <a></a> <a></a> </div>


        And then under the div you can place your pagination



        <div></div> <ul class="pagination"></ul>






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 25 '18 at 19:05









        getl0stgetl0st

        23419




        23419






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53470389%2fi-want-pagination-on-the-bottom-it-is-shown-on-the-right-side%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

            Calculate evaluation metrics using cross_val_predict sklearn

            Insert data from modal to MySQL (multiple modal on website)