Acil sıralama php yardım

karainci123 Murat özpolat

Merhaba arkadaslar ben sıralama.php dosyam var bu bir oyun sitesinin sıralama sayfası burada sınırsız sıralama var yani 1 sayfada sınırsız sıralama gösteriyor ben bu sıralamayı 50 kişi ile sınırlandırmak istiyorum bunu nasıl yapabilirim yardım edecek var mı ? 

 

<center><h5>Karakter Sıralaması - <a href="index.php?s=lsiralama">Lonca Sıralaması</a></h5></center>

<?PHP

  $CPSeite = 50;

  $markierteZeile=0;

  if(isset($_GET['p'])) {

    if(!checkInt($_GET['p']) || !($_GET['p']>0)) $aSeite = 1;

    else $aSeite = $_GET['p'];

  }

  else { $aSeite = 1; }

 

  if(isset($_POST['suche']) && $_POST['suche']=='Ara') {

    if(!empty($_POST['charakter'])) {

      $sqlCmd="SELECT id, name, level, exp, empire, guild_name, rang

      FROM (

 

        SELECT id, name, level, exp, empire, guild_name, @num := @num +20 AS rang

        FROM (

 

          SELECT player.id, player.name, player.level, player.exp, player_index.empire, guild.name AS guild_name, @num :=0

          FROM player.player

          LEFT JOIN player.player_index ON player_index.id = player.account_id

          LEFT JOIN player.guild_member ON guild_member.pid = player.id

          LEFT JOIN player.guild ON guild.id = guild_member.guild_id

          INNER JOIN account.account ON account.id=player.account_id

          WHERE player.name NOT LIKE '[%]%' AND account.status!='BLOCK'

          ORDER BY player.level DESC , player.exp DESC

 

        ) AS t1

 

      ) AS t2

 

      WHERE name = '".mysql_real_escape_string($_POST['charakter'])."' LIMIT 20";

      $sqlQry=mysql_query($sqlCmd,$sqlServ);

      if(mysql_num_rows($sqlQry)>0) {

 

        $getRang = mysql_fetch_object($sqlQry);

        $aSeite = ceil($getRang->rang/$CPSeite);

        $markierteZeile = $getRang->rang;

      }

 

    }

 

  }

 

  $sqlCmd = "SELECT COUNT(*) as summeChars  

  FROM player.player 

  LEFT JOIN player.player_index 

  ON player_index.id=player.account_id 

  LEFT JOIN player.guild_member 

  ON guild_member.pid=player.id 

  LEFT JOIN player.guild 

  ON guild.id=guild_member.guild_id

  INNER JOIN account.account 

  ON account.id=player.account_id

  WHERE player.name NOT LIKE '[%]%' AND account.status!='BLOCK'

  ORDER BY player.level DESC, player.exp DESC";

 

  $sqlQry = mysql_query($sqlCmd,$sqlServ);

 

  $getSum = mysql_fetch_object($sqlQry);

  $cSeite = calcPages($getSum->summeChars,$aSeite,$CPSeite);

 

?>

<style>

.kirmizi {

    background-color: #660000;

    color: #dec098;

    padding: 6px;

    text-align: center;

}

</style>

<table>

<tbody><tr width="700">

</tr><tr>

  <th class="kirmizi">#</th>

  <th class="kirmizi" width="120px">Karakter Adı</th>

  <th class="kirmizi" width="50px">Level</th>

  <th class="kirmizi" width="100px">Lonca</th>

  <th class="kirmizi" width="50px">Bayrak</th>

  <th class="kirmizi" width="120px">EXP</th>

</tr>

<?PHP

  $sqlCmd = "SELECT player.id,player.name,player.level,player.exp,player_index.empire,guild.name AS guild_name,guild.id AS guild_id 

  FROM player.player 

  LEFT JOIN player.player_index 

  ON player_index.id=player.account_id 

  LEFT JOIN player.guild_member 

  ON guild_member.pid=player.id 

  LEFT JOIN player.guild 

  ON guild.id=guild_member.guild_id 

  INNER JOIN account.account 

  ON account.id=player.account_id

  WHERE player.name NOT LIKE '[%]%' AND account.status!='BLOCK'

  ORDER BY player.level DESC, player.exp DESC 

  LIMIT ".$cSeite[1].",".$CPSeite;

 

  $sqlCmd2 = "SELECT player.name,player.account_id FROM player.player

    INNER JOIN account.account 

  ON account.id=player.account_id

  WHERE player.name NOT LIKE '[%]%' AND account.status!='BLOCK'";

 

  $sqlQry = mysql_query($sqlCmd,$sqlServ);

  $numrows = mysql_num_rows(mysql_query($sqlCmd2,$sqlServ));

  $x=$cSeite[1]+1;

  while($getPlayers = mysql_fetch_object($sqlQry)) {

    $zF = ($x%2==0) ? "thell" : "tdunkel";

    if(checkInt($markierteZeile) && $markierteZeile==$x) { $zF = "tmarkiert"; }

if ($getPlayers->guild_name == ""){ $loncasi = "<b>YOK<b>"; } else { $loncasi = $getPlayers->guild_name; }

    echo "<tr>";

    echo "<td class='beyaz'>".$x."</td>";

    echo "<td class='beyaz' width='120px'>".$getPlayers->name."</a></td>";

    echo "<td class='beyaz' width='50px'>".$getPlayers->level."</td>";

    echo "<td class='beyaz' width='100px'>".$loncasi."</td>";

    echo "<td class='beyaz' width='50px'>";

    if(!empty($getPlayers->empire)) {

      echo '<img src="images/reiche/'.$getPlayers->empire.'_kl.jpg" title="Bayrak" alt="Bayrak"/>';

    }

    echo "</td>";

echo "<td class='beyaz' width='120px'>".$getPlayers->exp."</a></td>";

    echo "</tr>";

 

    $x++;

 

  }

?>

 

<script language="javascript" src="http://is.sitekodlari.com/yukaricik19.js"></script>

 

</table>

30-08-2015 07:56

    www.Phpkodlari.com © 2009 Herkes Php öğrenecek
    Web tasarım ve eğitim kaynağınız.