Şimdi Ara

PHP MYSQL ARAMA VE SAYFALAMA

Bu Konudaki Kullanıcılar:
2 Misafir - 2 Masaüstü
5 sn
4
Cevap
0
Favori
469
Tıklama
Daha Fazla
İstatistik
  • Konu İstatistikleri Yükleniyor
0 oy
Öne Çıkar
Sayfa: 1
Giriş
Mesaj
  • Merhabalar.
    Kendimi geliştirmek için php mysql çalışıyorum deneme amacı ile okul bilgisi kayıt ve listeleme yaptım. alfabetik olarak, okula göre, ile göre gibi sıralamalar yapabiliyorum hatta arama kutusu yapıp sonuçları alabiliyorum ancak arama sonuçlarını sayfalandırmayı başaramadım. yardım ederseniz sevinirim.

    aşağıda kodları yazıyorum.



    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <link rel="stylesheet" href="css/sablon.css">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    </head>

    <body>

    <table border="0" align="center" cellpadding="5" cellspacing="5">

    <tr>
    <td align="center"><b><font color="#eeeeee"><a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=134498725&url=liste.php"title="Sırala" data-href="liste.php"title="Sırala">NO <img src="images/sort.png"></a></font></b></td>
    <td align="center"><b><font color="#eeeeee"><a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=134498725&url=listead.php" title="Sırala" data-href="listead.php" title="Sırala">ADI &nbsp;<img src="images/sort.png"></a></font></b></td>
    <td align="center"><b><font color="#eeeeee"><a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=134498725&url=listesoyad.php" title="Sırala" data-href="listesoyad.php" title="Sırala">SOYADI &nbsp;<img src="images/sort.png"></a></font></b></td>
    <td align="center"><b><font color="#eeeeee"><a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=134498725&url=listeokul.php" title="Sırala" data-href="listeokul.php" title="Sırala">OKULU &nbsp;<img src="images/sort.png"></a></font></b></td>
    <td align="center"><b><font color="#eeeeee"><a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=134498725&url=listebolum.php" title="Sırala" data-href="listebolum.php" title="Sırala">BÖLÜMÜ &nbsp;<img src="images/sort.png"></a></font></b></td>
    <td align="center"><b><font color="#eeeeee"><a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=134498725&url=listenumara.php" title="Sırala" data-href="listenumara.php" title="Sırala">NUMARASI&nbsp; <img src="images/sort.png"></a></font></b></td>
    <td align="center"><b><font color="#eeeeee"><a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=134498725&url=listeil.php" title="Sırala" data-href="listeil.php" title="Sırala">İLİ &nbsp;<img src="images/sort.png"></a></font></b></td>
    <td bgcolor="#CCCCCC" align="center"><b><font color="#000">İŞLEM</font></b></td>
    </tr>

    <?php include ("ayarlar.php");

    $kelime = $_POST['ara'];

    $makale = mysql_query("SELECT * FROM demo2 WHERE ad LIKE '%".$kelime."%'
    or soyad LIKE '%".$kelime."%'
    or okul LIKE '%".$kelime."%'
    or bolum LIKE '%".$kelime."%'
    or num LIKE '%".$kelime."%'
    or il LIKE '%".$kelime."%'");
    if (empty($kelime)) {
    echo "Arama alanını boş bırakamazsınız ";
    } else



    if(mysql_num_rows($makale) > 0)

    while($row=mysql_fetch_array($makale)){
    $ad = $row['ad'];
    $soyad = $row['soyad'];
    $okul = $row['okul'];
    $bolum = $row['bolum'];
    $num = $row['num'];
    $il = $row['il'];

    echo '<tr>
    <td width="30" height="20">'.$row['id'].'</td>
    <td width="100" height="20">'.$row['ad'].'</td>
    <td width="150" height="20">'.$row['soyad'].'</td>
    <td width="200" height="20">'.$row['okul'].'</td>
    <td width="150" height="20">'.$row['bolum'].'</td>
    <td width="50" height="20">'.$row['num'].'</td>
    <td width="100" height="20">'.$row['il'].'</td>
    <td bgcolor=#DDDDDD>
    <a href=sil.php?kayit_ID='.$row['id'].'>Sil</a>&nbsp;/&nbsp;
    <a href=duzelt.php?kayit_ID='.$row['id'].'>Değiştir</a>
    </td>
    </tr>';

    }

    else {
    echo "<b>$kelime</b> ile ilgili bir sonuç bulunamadı";
    }
    ?>
    </table>


    </body>
    </html>




    şimdiden teşekkür ederim..



  • calismayiwww.ayshost.net/demo adresinden görebilirsiniz.
  • Hiç boşa kodlarla uğraşma linki incele sayfana dahil et fazlasıyla işini görür.
    https://datatables.net/examples/basic_init/zero_configuration.html
  • 
Sayfa: 1
- x
Bildirim
mesajınız kopyalandı (ctrl+v) yapıştırmak istediğiniz yere yapıştırabilirsiniz.