<?php
$host='localhost';
$user='amrbook';
$password='AMRdahes03250@';
$dbname='allbook';
$conn = new mysqli($host, $user, $password, $dbname);
$conn->set_charset("utf8");
 
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}
$sql = "select * from amrbookpersnal";
$response= array(); 

$stmt = $conn->prepare($sql);
$stmt->execute();

$stmt->bind_result( $namebook ,$imagebook ,$uriread,$uridownlos,$id);
 
while($stmt->fetch()){
 
 $post = [
 'namebook'=>$namebook,
 'imagebook'=>$imagebook,
 'uriread'=>$uriread,
 'uridownlos'=>$uridownlos,
 'id'=>$id,
 
 ];
 
 array_push($response, $post);
}

echo json_encode(array("books"=>$response),JSON_UNESCAPED_UNICODE);


?>