I want to auto populate a form when I input an id. The form should be autofilled with data from the database(MYSQL). I have implemented using the following javascript,javascript but code is not working . Please help
//code:index.php
Select mfd type:
101
102
103
104
mfd-type
mfd-material
mfd-vendor
mfd-batch
mfd-date
//getUser.php
<?php
include 'db_con.php';
$conn = OpenCon();
$drop_mfd = $_REQUEST['drop_mfd'];
$mfd_auto_query = mysqli_query($conn,"SELECT * FROM mfd WHERE ID = '".$drop_mfd."'");
$rowss = mysqli_fetch_array($mfd_auto_query);
$mtype = $rowss['MFD_Type'];
$mmat = $rowss['MFD_Material'];
$mvend = $rowss['MFD_Vendor'];
$mbatch = $rowss['MFD_Batch'];
$mdate = $rowss['MFD_Received_on'];
$info = array("$mtype","$mmat","$mvend","$mbatch","$mdate");
echo json_encode($info);
?>