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" />
$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
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 <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 <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 <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Ü <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 <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İ <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> /
<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..