Jump to content

Archived

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

OLM3CA

pagin proglem in search

Recommended Posts

Hi I am having problems with the paging search results.Please help me I am trying to solve this for 3 hours.I think I have problem with the query of paging.My codes are below :

[code]$m = ($_REQUEST['m']);
  if ( ! $m) {  $m = "0";  }

$querym = "SELECT * FROM topic WHERE status=1 limit  $m,10";
$resultm = mysql_query($querym);
$rowm= mysql_num_rows($resultm);

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

  if(preg_match("/$word/i", $row['words']))
  {
          echo $row['name'];
          echo $row['msg'];

      $arama_sonuc++;  }  $toplam_sonuc++; }

echo "Pages:";
$i=0; while ( $i < $rowm) {  $a = $a + 1;

echo "<a href='ara3.php?m=$i'>$a</a>";
$i = $i + 2;
}[/code]

Share this post


Link to post
Share on other sites
$resultm = mysql_query($querym);
can be changed to
$resultm = mysql_query($querym) or die(mysql_error());
which will tell u where and what the error is

As far as i can see it looks like
$querym = "SELECT * FROM topic WHERE status=1 limit  $m,10";
needs to be
$querym = "SELECT * FROM topic WHERE status='1' limit  $m,10";

i probs have status set as a varchar instead of int

Regards
Liam

Share this post


Link to post
Share on other sites
Thanx for your reply but i have no error with page it works correct but i only see page 1 not the others ...

Share this post


Link to post
Share on other sites

×

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.