Make Previous Next page with mumer as in the image

0

I would like to split the select ItemID which is a maximum of 25000 records as well as this image but take only SELECT top 255 ItemID FROM PS_GameDefs.dbo.Items so as not to about loading the web.

I would like to make this button and integrate it into the scrip php to start I do not know what this page process is called.

Does anyone know how to do the image below and integrate it into php?

<?php
// Database configuration parameters
include "../../includes/db_connect2.php";
//Form Data
$ip = $_SERVER['REMOTE_ADDR'];
$count  = 1;
$rank   = 0;
$cimg   = 0;
$kdr    = 0;
$char  = '???';
$query  = ('SELECT * FROM PS_GameDefs.dbo.Items WHERE ItemName NOT LIKE  "%"+\'' . $char . '\'+"%"  ORDER BY ItemID');
$result = mssql_query($query);
echo "Country (6=AOL/UOF,2=AOL,5=UOF) IF A 1 apears in row signifying a class that is class that wears or uses item. /getitem useing Type space TypeID space Count you want.";
echo "<html><head><STYLE TYPE=\"text/css\">
<!--
td { background:url(image.png) no-repeat; }
td.i0{ background-position: 0 0; width: 28px; height: 16px; } 
td.i1{ background-position: 0 -26px; width: 28px; height: 16px; } 
td.i2{ background-position: 0 -52px; width: 28px; height: 16px; } 
td.i3{ background-position: 0 -78px; width: 29px; height: 16px; } 
td.i4{ background-position: 0 -104px; width: 29px; height: 15px; } 
td.i5{ background-position: 0 -129px; width: 28px; height: 18px; } 
td.i6{ background-position: 0 -157px; width: 30px; height: 17px; } 
td.i7{ background-position: 0 -184px; width: 29px; height: 17px; } 
td.i8{ background-position: 0 -211px; width: 28px; height: 16px; } 
td.i9{ background-position: 0 -237px; width: 28px; height: 18px; } 
td.i10{ background-position: 0 -265px; width: 29px; height: 18px; } 
td.i11{ background-position: 0 -293px; width: 29px; height: 24px; } 
td.i12{ background-position: 0 -327px; width: 29px; height: 18px; } 
td.i13{ background-position: 0 -355px; width: 29px; height: 18px; } 
td.i14{ background-position: 0 -383px; width: 29px; height: 18px; } 
td.i15{ background-position: 0 -411px; width: 29px; height: 18px; } 
td.i16{ background-position: 0 -439px; width: 29px; height: 18px; } 
td.i17{ background-position: 0 -467px; width: 24px; height: 24px; } 
td.i18{ background-position: 0 -501px; width: 24px; height: 24px; } 
td.i19{ background-position: 0 -535px; width: 24px; height: 24px; } 
td.i20{ background-position: 0 -569px; width: 24px; height: 24px; } 
td.i21{ background-position: 0 -603px; width: 24px; height: 24px; } 
td.i22{ background-position: 0 -637px; width: 24px; height: 24px; } 
</STYLE>
<title>Item List</title></head>";
echo "<body><center>
      <table cellspacing=10 cellpadding=0 border=0 bgcolor=\"black\">
      <td style=\"color:#FC9700\" bgcolor=\"black\">ItemName</td>
      <td style=\"color:#FC9700\" bgcolor=\"black\">Type</td>
      <td style=\"color:#FC9700\" bgcolor=\"black\">TypeID</td>
      <td style=\"color:#FC9700\" bgcolor=\"black\">Requierd Level</td>
      <td style=\"color:#FC9700\" bgcolor=\"black\">Country</td>
      <td style=\"color:#FC9700\" bgcolor=\"black\">Fight/War</td>
      <td style=\"color:#FC9700\" bgcolor=\"black\">Def/Guard</td>
      <td style=\"color:#FC9700\" bgcolor=\"black\">Ranger/Sin</td>
      <td style=\"color:#FC9700\" bgcolor=\"black\">Archer/Hunter</td>
      <td style=\"color:#FC9700\" bgcolor=\"black\">Mage/Pag</td>
      <td style=\"color:#FC9700\" bgcolor=\"black\">Priest/Orc</td>
      <td style=\"color:#FC9700\" bgcolor=\"black\">Max O.J.Stats</td>
      <td style=\"color:#FC9700\" bgcolor=\"black\">Count Per Stack</td>";
while ($row = mssql_fetch_array($result)) {
    echo "<tr style=\"color:white\">";
    echo "<td>" . $row[1] . "</td><td>" . $row[2] . "</td><td>" . $row[3] . "</td><td>" . $row[4] . "</td><td>" . $row[5] . "</td><td>" . $row[6] . "</td><td> " . $row[7] . "</td><td>" . $row[8] . "</td><td>" . $row[9] . "</td><td>" . $row[10] . "</td><td>" . $row[11] . "</td><td>" . $row[17] . "</td><td>" . $row[48] . "</td>";
    echo "</tr>";
    $count++;
}
echo "</table>";
echo "</html>";
?> 
    
asked by Juan Carlos Villamizar Alvarez 26.01.2017 в 15:14
source

1 answer

0

The way to solve this issue is using pagination in the query. the way to do it varies depending on the database engine used, but assuming it is MySQL you should use offset : link

Basically based on the N records returned by the query that you only from the record number X. With that you have resolved the paging. You just have to go calculating the offset according to the number of records per page.

I hope it serves you.

    
answered by 26.01.2017 в 15:38