diff --git a/db.php b/db.php deleted file mode 100644 index 5b97f0b..0000000 --- a/db.php +++ /dev/null @@ -1,15 +0,0 @@ -connect_error) { - die("Connection failed: " . $conn->connect_error); -} -?> - diff --git a/index.php b/index.php new file mode 100644 index 0000000..3350ecf --- /dev/null +++ b/index.php @@ -0,0 +1,125 @@ + + + + + + + + + + Book Store + + + +
+

Welcome, !

+

Explore our collection of books and shop your favorites.

+ + +
+
+ +
+ +
+
+
+ +
+ prepare($searchQuery); + $searchTerm = '%' . $search . '%'; + $stmt->bind_param("sss", $searchTerm, $searchTerm, $searchTerm); + $stmt->execute(); + $result = $stmt->get_result(); + + if ($result->num_rows > 0): + while ($row = $result->fetch_assoc()): + ?> +
+
+ <?= htmlspecialchars($row['title'] ?? 'No Title'); ?> +
+
+ + + +
+

Author:

+

Price: $

+ + + " class="btn btn-primary">Add to Cart + + + +
+
+
+ +

No books found matching your search.

+ +
+
+ + + + + + + + + + + + + + + +