Hello guys I hope you can help me with my problem I am making a library system
The main requirements in searching functions is to search Either booktitle, Author, Location of the book and the ISBN code or book code..
Here is my sample code in php
Legend: the catname part here is my category name which link to the name of my select
search name here is the input textbox where i can input the field.
Do you think my query is correct? I hope you can help me thanks
if(isset($_REQUEST['searchme']))
{
$catname = $con->real_escape_string($_POST['catname']);
$search = $con->real_escape_string($_POST['search']);
$query = $con->query("select bookname,bookid,bookdesc,location,
catname,qty,bookcode,copyright,editionnumber,publisher,author
from books inner join categories on categories.catname=books.catname
where bookname LIKE '%$search%' or author LIKE '%$search%' or bookcode LIKE '%$search%'") or die(mysqli_errno());
$result ->data_seek(0);
while($row = $result->fetch_assoc())
{
?>
<?php echo $row['bookname']???>
<?php <br mode="hold" /??> }
}
?>