< >

scrollladen.php


Quell Code


<?php
error_reporting(-1); 
ini_set('display_errors', 1);  
if(isset($_POST['start'])){
     if(!empty($_POST['start'])){
          $start=$_POST['start'];
          $menge=20;
          $datum = date("d.m.Y H:i:s");
          $mysqli = mysqli_connect('localhost', 'sebastian1012_page', 'basti1012', 'sebastian1012_page');
               if (mysqli_connect_errno())
                       die ("Connect failed: " . mysqli_connect_error());
                       mysqli_set_charset($mysqli, "utf8");
                       $query = "Select *  from  `error404`   order by        `id`asc       limit $start,$menge";
                       $result = mysqli_query($mysqli, $query)
                       or die ("MySQL-Error: " . mysqli_error($mysqli));
                 
                       if (mysqli_num_rows($result)){
                            while ($row = mysqli_fetch_assoc($result)){
                                 echo  '<tr> 
                                 <td>'.$row['meldung'].'</td>
                                 </tr>';

                            }
                       } else {
                            echo"<tr><td colspan='5'>Keine Einträge in der Datenbank vorhanden</tr>";
                       }
     }else{
           echo " ajax sendet leer";
      }
}else{
    echo "<h1>Inhalte per Ajax (jQuery) nachladen beim Seitenende</h1>";
}    
?>