0

Hi i have my php search code,i got result in hte other page i want to see my result in the same page below the search button where i insert the field to submit that query.plz give me as possible as soon....
And i make a search page on this i give the form action to the other page and i want to print that form in my search form give any idea

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by JANNAT123
0
<?php
	//Include the PS_Pagination class
	include('ps_pagination.php');
	//Connect to mysql db
	 $user="root2";
$password="123";
$database="calendar";
  $conn = mysql_connect('localhost',$user,$password);
	if(!$conn) die("Failed to connect to database!");
	$status = mysql_select_db($database, $conn);
	if(!$status) die("Failed to select database!");
	 $a=$_POST[department];
 $b= $_POST[ptitle];
 $c= $_POST[pvenue];
 $d= $_POST[faculty1];
 $e= $_POST[from];
 $f= $_POST[to];
  
 echo "<table border='1' align='center'><tr>
 <th>S.No.</th>
<th>Programme code</th>
<th>Programme Title</th>
<th>Department Name</th>
<th>Venue Name</th>
<th>Faculty Name</th>
<th>From</th>
<th>To</th>
<th>Online Apply</th>  
</tr>";

 if(($d) ||  ($a )|| ($e) ||($f) || ($c))
 {
	$sql="SELECT programme_code,programme_title,department_name,venue_name,faculty1 ,DATE_FORMAT(date_from,'%d-%b-%Y') AS F,DATE_FORMAT(date_to,'%d-%b-%Y') AS T FROM programme WHERE  faculty1='$d' OR department_name='$a' OR date_from BETWEEN STR_TO_DATE('$e','%d-%b-%Y') AND STR_TO_DATE('$f','%d-%b-%Y') OR venue_name='$c'";
	//Create a PS_Pagination object
	$pager = new PS_Pagination($conn, $sql, 8, 3, 'param1=value1&param2=value2');
	//The paginate() function returns a mysql
	//result set for the current page
	$rs = $pager->paginate();
	$m=1;
	//Loop through the result set
	while($row = mysql_fetch_array($rs))
  {
   $i=$row[programme_code];
   $j=$row[programme_title];
  echo "<tr>";
   echo "<td>".$m++."</td>";
  echo "<td><a href='http://localhost/programmedisplay.php?c=$i'>". $row[programme_code] ."</a></td>";
  echo "<td>" . $row[programme_title]. "</td>";
  echo "<td>" . $row[department_name]. "</td>";
  echo "<td>" . $row[venue_name] . "</td>";
  echo "<td>" . $row[faculty1]. "</td>";
  echo "<td>" . $row[F]. "</td>";
  echo "<td>" . $row[T]. "</td>";
   echo "<td>" ."<a href='onlineregistration.php?c=$j'>Apply</a>". "</td>";
  echo "</tr>";
  }
 }
   echo "</table>";
	//Display the navigation
	echo $pager->renderFullNav();
?>

Edited by Ezzaral: Added code tags. Please use them to format any code that you post.

0

plz give me answer as soon as possible and also give code to do this pagination for the next page

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.