prepare($sql_str); $stmt->bindParam(':id',$id); $stmt->execute(); $prices = $stmt->fetch(PDO::FETCH_ASSOC); header("Content-Type: application/json"); echo json_encode(['prices'=> $prices]); }catch (PDOException $e ){ die("ERROR!!!: ". $e->getMessage()); }