Jump to content


Photo

pagin proglem in search


  • Please log in to reply
3 replies to this topic

#1 OLM3CA

OLM3CA
  • Members
  • PipPipPip
  • Advanced Member
  • 52 posts
  • LocationCyprus

Posted 16 September 2006 - 02:33 PM

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 :

$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;
}

AMD rather than Intel , PHP rahter than ASP

#2 shocker-z

shocker-z
  • Members
  • PipPipPip
  • Advanced Member
  • 864 posts
  • LocationNottingham

Posted 16 September 2006 - 03:17 PM

$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
www: www.ukchat.ws | irc: irc.ukchat.ws chan: #blufudge

#3 OLM3CA

OLM3CA
  • Members
  • PipPipPip
  • Advanced Member
  • 52 posts
  • LocationCyprus

Posted 16 September 2006 - 03:32 PM

Thanx for your reply but i have no error with page it works correct but i only see page 1 not the others ...
AMD rather than Intel , PHP rahter than ASP

#4 OLM3CA

OLM3CA
  • Members
  • PipPipPip
  • Advanced Member
  • 52 posts
  • LocationCyprus

Posted 16 September 2006 - 10:21 PM

ı am sorry for this spam but i really need help please
AMD rather than Intel , PHP rahter than ASP




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users