I am having trouble in displaying my search results onto another php page.
Below is my php code for my second php page:
if (isset($_GET['bookTitle'])) {
$bookTitle = $_GET['bookTitle'];
$sqlSearch = "SELECT bookISBN, bookTitle, bookYear, nbc_book.catID, nbc_book.pubID, pubName, location, catDesc, bookPrice FROM nbc_book
LEFT JOIN nbc_category ON nbc_book.catID = nbc_category.catID
LEFT JOIN nbc_publisher ON nbc_book.pubID = nbc_publisher.pubID LIKE CONCAT('%', bookTitle, '%')
WHERE bookTitle = " . $_GET['booktitle'] ;
echo "string";
$resultSearch = mysqli_query($conn,$sqlSearch) or die (mysql_error());
while ($row = mysqli_fetch_assoc($resultSearch)){
$category = $row['catDesc'];
$bookTitle = $row['bookTitle'];
$publisherName = $row['pubName'];
$bookYear = $row['bookYear'];
$bookPrice = $row['bookPrice'];
echo "Result found!";
}
}else{
echo "Result not found!";
}
mysqli_free_result($resultSearch);
mysqli_close($conn);
This is the error i am getting:
Result not found!
Notice: Undefined variable: querySearch in /
Warning: mysqli_free_result() expects parameter 1 to be mysqli_result, null given in /
Can anyone help me to solve my problem. I would be glad if someone can help me solve this problem.