php - MySQL Pagination Filter Problems -
i'm trying pagination , 3 filter on php - mysqli. mysql query works on phpmyadmin, not on php page. wrong?
<?php include("header.php"); if(isset($_get['numara'], $_get['adsoyad'], $_get['firmaadi'])) { $numaram=$_get['numara']; //numbers $adsoyad=$_get['adsoyad']; //firstname , lastname $firmaadi=$_get['firmaadi']; //company name } else { $numaram=""; $adsoyad=""; $firmaadi=""; } $sorgu = mysqli_query($mysqllink,"select `id`, `numara`, `tarih`, `adsoyad`, `firmaadi` `numaralar` (`numara` '%$numaram%' or `adsoyad` '%$adsoyad%' or `firmaadi` '%$firmaadi%') order `id`"); if (isset($_get["syf"])) { $syf=$_get["syf"]; } else { $syf=1; } $limit=3; $kayitsayisi=mysqli_num_rows($sorgu); $sayfasayisi=ceil($kayitsayisi/$limit); $baslangic=($syf*$limit)-$limit; ?> <div id="divin"> <form method="get" action="numaralistele2.php"> numara: <input type="textbox" name="numara"> adı soyadı: <input type="textbox" name="adsoyad"> firma adı: <input type="textbox" name="firmaadi"> <input type="submit" name="button" id="button" value="arama yap"> </form> <?php $sorgu2=mysqli_query($mysqllink,"select `id`, `numara`, `tarih`, `adsoyad`, `firmaadi` `numaralar` (`numara` '%$numaram%' or `adsoyad` '%$adsoyad%' or `firmaadi` '%$firmaadi%') order `id` limit $baslangic,$limit"); echo "<table>"; echo '<tr> <td>silme</td><td>id</td><td>numara</td><td>tarİh</td><td>adi soyadi</td><td>fİrma adi</td> </tr>'; while($kayit=mysqli_fetch_array($sorgu2)){ echo '<tr>'; echo '<td><a href="delete.php?id='.$kayit[0].'">sil</a></td>'; echo '<td>'.$kayit[0].'</td>'; echo '<td>'.$kayit[1].'</td>'; echo '<td>'.$kayit[2].'</td>'; echo '<td>'.$kayit[3].'</td>'; echo '<td>'.$kayit[4].'</td>'; echo '</tr>'; } echo '</table>'; if ($sayfasayisi>1){ echo '<div style="margin-left:42%; position:absolute; bottom:0;" class="sayfalama">'; ($i=1;$i<=$sayfasayisi;$i++){ echo '<a href="numaralistele2.php?numara='.$numaram.'&adsoyad='.$adsoyad.'&firmaadi='.$firmaadi.'&syf='.$i.'"'; if ($syf==$i){ echo 'class="syf_aktif"';} echo '>'.$i.'</a>'; } echo '</div>'; } echo '</div>'; ?> <?php include("footer.php"); ?>
numara
mean numbersadsoyad
mean firstname , lastnamefirmaadi
mean company name
i'm trying make filter in textbox doesn't filter , loads everything.
you have write query this:
$sorgu2=mysqli_query($mysqllink,"select `id`, `numara`, `tarih`, `adsoyad`, `firmaadi` `numaralar` (`numara` '%$numaram%' , `adsoyad` '%$adsoyad%' , `firmaadi` '%$firmaadi%') order `id` limit $baslangic,$limit");
Comments
Post a Comment