thanks sameer for replying
here is my code
form.php
<Form action="pageauthor.php" method="post">
Title:<input type=text size="50" name="title" ><br><br>
<input type=submit value="Submit Search">
</form>
'$title' variable from form
titlesearch.php
<?Php
$connection=mysql_connect($hostname,$user,$pass) or die("Unable to connect");
$limit =10; // connecting to the databse
//$search=$HTTP_POST_VARS['title'];
//counting total result rows
$query ="select distinct bid from title, books where title.id=books.fktitleid";
$query .=" and (";
$titlet=trim($HTTP_POST_VARS['title']);
$keywords=split(" ",$titlet);
for($x=0;$x<sizeof($keywords); $x++)
{
trim($keywords[$x]);
if($x!=0)
{
$query .=" OR ";
}
$query .="(title.title like'%$keywords[$x]%' )";
}
$query.=")";
echo"$query";
$result_count=mysql_db_query($database,$query,$connection) or die("Error in query1:$query". mysql_error());
$totalrows=mysql_num_rows($result_count);
echo"totalrows :$totalrows";
//pagination code
if(empty($page))
$page = 1;
echo"<br>page :$page<br>";
$limitvalue = $page * $limit - ($limit);
//querying for limit $limitvalue, limit.
$query ="select distinct bid from title, books where title.id=books.fktitleid";
$query .=" and (";
$titlet=trim($search);
$keywords=split(" ",$titlet);
for($x=0;$x<sizeof($keywords); $x++)
{
trim($keywords[$x]);
if($x!=0)
{
$query .=" OR ";
}
$query .="(title.title like'%$keywords[$x]%' )";
}
$query.=")limit $limitvalue, $limit";
echo"$query";
$result=mysql_db_query($database,$query,$connection) or die("Error in query1:$query". mysql_error());
$count_result=mysql_num_rows($result);
// Display links at the top to indicate current page and number of pages displayed
$numofpages = ceil($totalrows / $limit);
echo"<br><p><b>$totalrows</b> result(s) for:";echo"$search </p>";
$from=$limit*$page-$limit+1;
$to=$from + $count_result-1;
// start 123 next>> table
?>
displaying result
<table align="center" width="90%" border="2" cellspacing="0" cellpadding="0">
<tr><td width="20%" bgcolor="#E7,E0,BE" align="left">
<?if($numofpages>1)
{echo"Showing:$from-$to"; ?>
</td><td width="70%" bgcolor="#E7,E0,BE"; align="right"><b>Go to page:</b> <?}?>
<?php
// display previous link if page is not 1
if($page != 1){
$pageprev = $page - 1;
echo("<a href='$PHP_SELF?page=$pageprev&search=$search'><< PREV</a> ");
}
// display page nos if not 1
for($i = 1; $i <= $numofpages; $i++){
if($numofpages>1){
if($i == $page)
echo(" ".$i." ");
else
echo(" <a href='$PHP_SELF?page=$i&search=$search'>$i</a> ");
}}
// display next page link if there is more than one
if(($totalrows - ($limit * $page)) > 0){
$pagenext = $page + 1;
echo("<a href='$PHP_SELF?page=$pagenext&search=$search'>NEXT >></a>");
}
// end 123 next>> table
?>
</td></tr>
</table>
<table align="center" width="90%" border="2" cellspacing="0" cellpadding="0">
<tr>
<th width="10%" align="center" style="background-color: #0000FF" >
<FONT FACE="verdana" color="#FFCD82" SIZE="-1">
Books</font>
</th>
<th width="80% height=18 align=right style="background-color: #0000FF" >
<FONT FACE="verdana" color="#FFFFF0" SIZE="-1">
Your Search returned <? echo"$totalrows";?> match(es)</font>
</th></tr>
<tr><td width="10%" height="10">
</td><td width="80%" height="10">
</td></tr>
<?php
while($row=mysql_fetch_array($result))
{
$qbid=$row['bid'];
$query ="select au_name from author, authorc where authorc.auid=author.id and authorc.bid='$qbid'";
$result2=mysql_db_query($database,$query,$connection) or die("Error in query2:$query". mysql_error());
?>
<tr><td width="10%" valign="top">
<ul>
<li> </li>
</ul>
</td><td width="80%" wrap>