Domain: amberpublishers.in
Server Adress: 86.38.243.169
privdayz.com
<?php
// Connect to the database (assuming you have a database connection already set up)
include 'db_connect.php';
// Get the category from the request (assuming it's passed as a query parameter named "category")
$category = $_GET['category'];
// Retrieve book details of the selected category from the database
$sql = "SELECT * FROM book_details WHERE category = '$category'";
$result = mysqli_query($conn, $sql);
// Fetch the book details and format the response
$books = array();
while ($row = mysqli_fetch_assoc($result)) {
$books[] = $row;
}
// Return the book details as JSON response
header("Content-Type: application/json");
echo json_encode($books);
// Close the database connection
mysqli_close($conn);
?>
