I can not seem to receive the json response when i make an ajax request to my php file;
I have tried to send ajax request and receive json response.
My Javascript:
$(".edit_data").click(function(){
            var id= $(this).attr("id");
            alert(id);
            $.ajax({
                url: "edit.php",
                type: "POST",
                data: {edit_id: id},
                dataType: "jsonp",
                contentType: "application/json; charset=utf-8",
                success: function(data){
                    var title=data.title;
                    var body=data.body;
                    $("#mtitle").val(data.title);
                    $("#msummernote").val(data.body);
                }
            });
            alert('t'.title);
            alert('b'.body);
            alert('hey');
            $('#myModal').modal('show'); 
        });
the alert for title and body says they are undefined and my edit.php:
<?php
   include 'db_connect.php';
   $id= $_POST['edit_id'];
   $stmt= "SELECT * FROM blog WHERE id=".$id;
   $result= $conn->query($stmt);
   $rows = $result->fetch_assoc();
   echo json_encode($rows);
?>
in my html i have a table like this:
    <table class="table-striped" style="width:80%">
                <tr>
                    <th>Title</th>
                    <th>Author</th>
                </tr>
                    <?php
                        while($rows = $result->fetch_assoc())
                        {
                    ?>
                <tr>
                    <td><?php echo $rows['title']?></td>
                    <td><?php echo $rows['uname']?></td>
                    <td><button name="edit" id="<?php echo $rows['id']; ?>" type="button" class=" edit_data btn btn-warning" >Edit  </button></td>
                    <td><button name="delete" id="<?php echo $rows["id"]; ?>" class="btn btn-danger">Delete</button></td>
                </tr>
                    <?php
                        }
                    ?>
            </table>
and the bootstrap modal i am trying to populate:
    <!-- Modal Header -->
    <div class="modal-header">
      <h4 class="modal-title">Edit Post</h4>
      <button type="button" class="close" data-dismiss="modal">×</button>
    </div>
    <!-- Modal body -->
    <div class="modal-body">
    <form method="post" id="insert_form">
        <label> Title: </label>
        <input name="mtitle" class="form-control" type="text" required placeholder="Title"/>
        <br><br>
        <label> Header Image: </label>
        <input class="form-control" type="file" name="file" id="file"><br><br>
        <label> Body: </label>
        <textarea name="content" id="msummernote"></textarea>
        <button class="btn btn-primary" name="submit"> Submit </button>
    </form>
    </div>
    <!-- Modal footer -->
    <div class="modal-footer">
      <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
    </div>
  </div>
</div>
I am trying to populate the field with id mtitle with the title i receive from  the json and the field with id msummernote with the body i recieve from the json
 
    