if query passed in search box by selecting the category as fiction or whatever it may be, it should search in both title and author, if value got in title then no need to search in author, if not need to search in author,

    $search = $_POST['searchvalue']; //assume search value as xyz
    $name = $_POST['name'];// assume category as fiction

 $construct = "SELECT * FROM books WHERE category = $name  AND (title LIKE '%$search%' or author LIKE '%$search%')";
     $run = mysql_query($construct);
     $foundnum = mysql_num_rows($run);// I am getting error here

please anyone help me
database table is given below

Thank you very much it worked...