OLM3CA Posted September 16, 2006 Share Posted September 16, 2006 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] Link to comment https://forums.phpfreaks.com/topic/20976-pagin-proglem-in-search/ Share on other sites More sharing options...
shocker-z Posted September 16, 2006 Share Posted September 16, 2006 $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 isAs 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 intRegardsLiam Link to comment https://forums.phpfreaks.com/topic/20976-pagin-proglem-in-search/#findComment-93036 Share on other sites More sharing options...
OLM3CA Posted September 16, 2006 Author Share Posted September 16, 2006 Thanx for your reply but i have no error with page it works correct but i only see page 1 not the others ... Link to comment https://forums.phpfreaks.com/topic/20976-pagin-proglem-in-search/#findComment-93046 Share on other sites More sharing options...
OLM3CA Posted September 16, 2006 Author Share Posted September 16, 2006 ı am sorry for this spam but i really need help please Link to comment https://forums.phpfreaks.com/topic/20976-pagin-proglem-in-search/#findComment-93240 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.