im having problem getting the output of php script passing it to html inputs
this is my php script
$stmt->execute();
if ($stmt->rowCount() > 0){
$row = $stmt->fetch(PDO::FETCH_ASSOC);
echo 'Found: ' . $row['doctitle'] . ' ' . $row['doctype'];
}else {
echo "error";
}
and this is my ajax
$.ajax({
type: "POST",
url: "receive.php",
data: ({dtnum: "00001"})
})
.done(function (msg) {
alert("output: " + msg);
})
.fail(function() {
alert( "Posting failed." );
});
and this is my html
<input type="text" name="doctitle"><br>
<input type="text" name="doctype"><br>
im getting the desired output but what i want to do is pass the output for each row in php script to each designated html input