missing table
The code is great but there is no category table. Hence, it can't search for book
-- -- Table structure for table `book` --
<?php include('../admin/include/dbcon.php'); { $keyword = $_POST['keyword']; $status = $_POST['status']; if ($status == '--All--') { LEFT JOIN category ON book.category_id = category.category_id where (category.classname like '%$keyword%' or (book_barcode like '%$keyword%' or book_title like '%$keyword%' or author like '%$keyword%' or copyright_year like '%$keyword%')) } elseif ($status == 'Title') { LEFT JOIN category ON book.category_id = category.category_id where book_title like '%$keyword%' } elseif ($status == 'Author') { LEFT JOIN category ON book.category_id = category.category_id where author like '%$keyword%' } elseif ($status == 'Category') { LEFT JOIN category ON book.category_id = category.category_id where classname like '%$keyword%' } elseif ($status == 'Copyright') { LEFT JOIN category ON book.category_id = category.category_id where copyright_year like '%$keyword%' } elseif ($status == 'Barcode') { LEFT JOIN category ON book.category_id = category.category_id where book_barcode like '%$keyword%' } else { LEFT JOIN category ON book.category_id = category.category_id } $book_id=$row['book_id']; $cat_id=$row['category_id']; ?>
<?php ?>