whole page is reloading when clicking pagination in datatable instead of moving to next page in php

whole page is reloading when clicking pagination in datatable instead of moving to next page in php

bharathsiva007bharathsiva007 Posts: 5Questions: 2Answers: 0

i have used basic datatable script but i getting this problem.But if i click column header and again i click the pagination in datatable the pagination is working fine.How to solve this.Kindly give tips.Thanks in advance

```

$('#long_schd_table').DataTable({

});

Answers

  • bharathsiva007bharathsiva007 Posts: 5Questions: 2Answers: 0

    can anyone help me to solve this issue

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @bharathsiva007 ,

    We're happy to take a look. As per the forum rules, if you could link to a running test case showing the issue we can offer some help. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • bharathsiva007bharathsiva007 Posts: 5Questions: 2Answers: 0
    edited November 2018
    //php
     <?php include 'header.php'; ?>
     </style>
          <!-- Breadcrumbs -->
          <section class="bg-gray-7">
            <div class="breadcrumbs-custom box-transform-wrap context-dark">
              <div class="container">
                <h3 class="breadcrumbs-custom-title">Sailing Schedules</h3>
                <div class="breadcrumbs-custom-decor"></div>
              </div>
              <div class="box-transform" style="background-image: url(images/bg-typography.jpg);"></div>
            </div>
            <div class="container">
              <ul class="breadcrumbs-custom-path">
                <li><a href="index.php">Home</a></li>
                <li class="active">Sailing Schedule</li>
              </ul>
            </div>
          </section>
    
    <br>
    <br>
    <div class="container">
        
    <?php
                    ini_set('display_errors', 1);
                       error_reporting(E_ALL);
    
                        // Include config file
                       require 'config.php';
    
                        $sql = "SELECT * FROM long_sched";
                        if($result = mysqli_query($con, $sql)){
    
                            if(mysqli_num_rows($result) > 0){
                        echo "<table class='table-custom table-custom-primary' id ='long_schd_table'>";
                                    echo "<thead>";
                                        echo "<tr>";
                                            echo "<th>Service Name</th>";
                                            echo "<th>Description</th>";
                                        echo "</tr>";
                                    echo "</thead>";
                                    echo "<tbody>";
                                    while($row = mysqli_fetch_array($result)){
                                        echo "<tr>";
                                    
    
                                 echo "<td><a href=http://localhost/permatest/". $row['long_filepath'] . " target='_self' download>".$row['long_service']."</a></td>";
    
                                echo "<td>" . $row['long_desc'] . "</td>";
    
                                
    
    
    
                                        echo "</tr>";
                                    }
                                    echo "</tbody>";                            
                                echo "</table>";
                                // Free result set
                                mysqli_free_result($result);
                            } 
    
                            else{
                                echo "<p class='lead'><em>No records were found.</em></p>";
                            }
                        } else{
                            echo "ERROR: Could not able to execute ".$sql." " . mysqli_error($con);
                        }
     
                        // Close connection
                        mysqli_close($con);
    
    <?php
    >
    ?>
    
    
    
    </div>
    
    
    </section>
    <br>
    <br>
    
    <?php include 'off_footer.php'; ?>
    
    
     //js
    
    
    
    
    
      $('#long_schd_table').DataTable({
        
      
      });
    
    
    
    
    
  • bharathsiva007bharathsiva007 Posts: 5Questions: 2Answers: 0
    edited November 2018

    the above is my code. I am new to this forum.I have problem in my clients live site.

  • allanallan Posts: 63,464Questions: 1Answers: 10,466 Site admin

    Can you link to the live site please. I don't see anything obviously wrong with the above.

    Allan

This discussion has been closed.