$_SESSION["srch"] = trim($_GET["search"]);
	$var = $_SESSION["srch"];
	$searchinfo = array();
//////Home
		$viewQuery1=mysql_query("select * from home_content where hc like \"%$var%\"  ") or die(mysql_error());
		if(mysql_num_rows($viewQuery1) > 0)
		{	
			while($Res1 = mysql_fetch_array($viewQuery1))
			{  
			$searchinfo[0] .=	'<a href="home.php?pk='.$Res1['parent_key'].'">'. substr($Res1['hc'],0, 25).'</a>';
			}//while 
$num = mysql_num_rows($viewQuery1);
		}//if
		
//////END Home
//////HIGHLIGHTS
		$viewQuery2=mysql_query("select * from highlights where hl_c like \"%$var%\"  ") or die(mysql_error());
		if(mysql_num_rows($viewQuery2) > 0)
		{	
			while($Res2 = mysql_fetch_array($viewQuery2))
			{
			$searchinfo[]["searchresult"] .=	'<a href="highlights.php?hk='.$Res2['hl_parent_key'].'">'. substr($Res2['hl_c'],0, 25).'</a>';
			}//while 
		}//if
 $num += mysql_num_rows($viewQuery2);
//////END HIGHLIGHTS
//////activities
		$viewQuery3=mysql_query("select * from activities where act_c like \"%$var%\"  ") or die(mysql_error());
		if(mysql_num_rows($viewQuery3) > 0)
		{	
			while($Res3 = mysql_fetch_array($viewQuery3))
			{
			$searchinfo[]["searchresult"] .=	'<a href="activities.php?actk='.$Res3['act_parent_key'].'">'. substr($Res3['act_c'],0, 25).'</a>';
			}//while 
		}//if
//////END activities
 $num += mysql_num_rows($viewQuery3);
//////prespective
		$viewQuery4=mysql_query("select * from prespective where pp_c like \"%$var%\"  ") or die(mysql_error());
		if(mysql_num_rows($viewQuery4) > 0)
		{	
			while($Res4 = mysql_fetch_array($viewQuery4))
			{
			$searchinfo[]["searchresult"] .=	'<a href="prespective.php?ppk='.$Res4['pp_parent_key'].'">'. substr($Res4['pp_c'],0, 25).'</a>';
			}//while 
		}//if
//////END prespective
 $num += mysql_num_rows($viewQuery4);
//////roadmap
		$viewQuery5=mysql_query("select * from roadmap where rm_c like \"%$var%\"  ") or die(mysql_error());
		if(mysql_num_rows($viewQuery5) > 0)
		{	
			while($Res5 = mysql_fetch_array($viewQuery5))
			{
			$searchinfo[]["searchresult"] .=	'<a href="activities.php?rmk='.$Res5['rm_parent_key'].'">'. substr($Res5['rm_c'],0, 25).'</a>';
			}//while 
		}//if
//////END activities
 $num += mysql_num_rows($viewQuery5);
//////faq
		$viewQuery6=mysql_query("select * from faq where faquestion like \"%$var%\" or answer like \"%$var%\" ") or die(mysql_error());
		if(mysql_num_rows($viewQuery6) > 0)
		{	
			while($Res6 = mysql_fetch_array($viewQuery6))
			{
			$searchinfo[]["searchresult"] .=	'<a href="faq1.php?fid='.$Res6['faq_id'].'">'. substr($Res6['faquestion'],0, 25).'</a>';
			}//while 
		}//if
		 $num += mysql_num_rows($viewQuery6);   $rn = $num;
//////END activities

anybody can tell me how should i do pagination for array $searchinfo[]["searchresult"]

pls help

Member Avatar for diafol

This code has just been dumped without any explanation. If you want a paginator, search this site, it has been discussed to death over the last year. Equally, 'php pagination' will return about 1000 relevant hits in Google. I think you're spoilt for choice mate.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.