Jump to content

Php Sayfalatma Kodu


Recommended Posts

Sayfalatma Kodu aşağıdadır

					  <?php
require("config.php");
$baglan=mysql_connect($hostname,$username,$passwor  d);
mysql_select_db($db_name) or die ("Database ulaşılamadı");
$pass="asdasdasd";
$say=5;
$result = mysql_query( "SELECT * FROM admin " );
$num_rows = mysql_num_rows( $result );
$deger = $num_rows / 5 ;
$deger_sonuc=(integer)$deger;
if($num_rows!=$deger_sonuc*5){
$deger_sonuc=$deger_sonuc + 1;
}
$basla = $_GET["basla"] ? $_GET["basla"] : 1; // Kactan baslayacak?
$ksayfa=($basla - 1) * 5;
$result2 = mysql_query( "SELECT * FROM admin limit $ksayfa,5" );
echo "$deger_sonuc <p>";
print "<table border=1>\n";
while ( $a_row = mysql_fetch_row( $result2 ) )
{
print "<tr>\n";
foreach ( $a_row as $haber )
print "\t<td>$haber</td>\n";
print "</tr>\n";
}
print "</table>\n";
   for ($sayac = 1; $sayac <= $deger_sonuc ; $sayac++ ) {
if($sayac==$basla){
echo "$sayac ";
}else{
echo "<a href=\"?basla=$sayac\" style=\"text-decoration: none\">[$sayac] </a>";
}
}
mysql_close( $baglan );
?>

Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.