I have a series of php, ajax and js files to be able to process my information obtained from my database (MySQL) and at the same time I want to send them to a modal using a .js
So far I can get my result from my query using a var_dump:
This is the code of my query, I want to process it to json to later send it from a js.
<?php
$id_sol = $_POST['id'];
$solicitud = SolicitudData::getTraslateAlmacen($id_sol);
echo json_encode($solicitud);
var_dump($solicitud);
?>
This my .js
function obtenerDatos(id){
$.post("index.php?action=getTraslateAlmacen", { id : id }, function( data ){
var data = JSON.parse(data);
$("#process_id").val(data.id);
$("#folio").val(data.folio_solicitud);
});
}
Investigating what I need is converting my php query to json objects but I can not get it.