+
+
+
+
+
+
\ No newline at end of file
diff --git a/search.php b/search.php
index c9c7b22..3639dd5 100644
--- a/search.php
+++ b/search.php
@@ -39,10 +39,10 @@
$db_name = 'Library';
$con = mysqli_connect('localhost', 'root', 'root', "$db_name") or die(mysql_error());
// $db = mysql_select_db('Library', $con);
- $search='%'.$search.'%';
- echo($search);
+ $WildSearch='%'.$search.'%';
+ //echo($search);
$query = "select b.ISBN, b.title, group_concat(a.Author_name) as author_name, b.cover, b.pages from book as b, book_authors as ba, authors as a Where b.ISBN=ba.ISBN and ba.Author_id=a.Author_id and
-(a.Author_name like "."'$search'"." or b.isbn="."'$search'"." or b.Title like "."'$search'".") GROUP BY b.ISBN";
+(a.Author_name like "."'$WildSearch'"." or b.isbn="."'$search'"." or b.Title like "."'$WildSearch'".") GROUP BY b.ISBN";
// echo ($query);
@@ -60,7 +60,11 @@
for ( $i = 0 ; $i < mysqli_num_rows($result) ; $i++ )
{
$row = mysqli_fetch_assoc($result);
- echo "
";
+ $avail_query = "select count(*) as count from book_loans where ISBN='".$row['ISBN']."' and Date_in is null";
+
+ $avail_result = mysqli_query($con, $avail_query);
+ $avail_row = mysqli_fetch_assoc($avail_result);
+ echo "