Jump to content

HELP paging!


powaz

Recommended Posts

need help with paging i have php code:

$eilutes = 3;

$psl_nr = 1;

if(isset($_GET['page']))

{

    $psl_nr = $_GET['page'];

}

$nuo = ($psl_nr - 1) * $eilutes;

 

$komentaras="SELECT * WHERE

psalis like'%".$psalis."'

and issalis like'%".$issalis."'

and dID NOT LIKE'".$dID."' LIMIT $nuo, $eilutes

;";

 

$uzklausa=mysql_query($komentaras,$db);

$i=mysql_num_rows($uzklausa);

 

$query="SELECT COUNT(dID) AS numrows FROM kroviniai WHERE

psalis like'%".$psalis."'

 

and dID NOT LIKE'".$dID."'

;";

 

$result  = mysql_query($query) or die('Error, query failed');

$row = mysql_fetch_array($result);

$eil_sk =$row['numrows'];

$max_psl = ceil($eil_sk/$eilutes);

 

if($uzklausa){

while ($row = mysql_fetch_array($uzklausa)){

echo '<tr>';

echo '<td width="30"><div align="center">

<form action="isplestine_paieska_kroviniai.php" method="post" name="form1" onsubmit="naujaslangas(this)">

<input type="hidden" name="id[]" value="'.$row['cID'].'">'.$row['cID'].'</div></td>';

 

echo '<td width="100"><div align="left"><img src="flags/'.$row["psalis"].'.png"> '.$row["psalis"].'</div></td>';

cho '<td width="80"><div align="left">'.$row["isdata"].'</div></td>';....

echo '<td width="40" align="center"><input type="submit" class="mygtukai" value="info"/></form></div></td>';

}

echo '</tr></table>';

}

$self = $_SERVER['PHP_SELF'];

for($page = 1; $page <= $max_psl; $page++)

{ if ($page == $pageNum){$nav .= " $page ";  }

else{$nav .= " <a href=\"$self?page=$page\">$page</a> ";}

}

$nav;

?>

then I'm running page at 1-st time paging is ok, but i'm have the form in same page(search), so then I'm doing search paging wrong...

so i thing i need to get another header like (my.page.php) but i don't know haw to do please help me !!!!

 

Link to comment
https://forums.phpfreaks.com/topic/52223-help-paging/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.