Greetings. I need to obtain the records of a specific row, through ajax I am sending the id to php and I get the row, but I am not able to manipulate the data and then assign them to html elements. Where will the error be?
$(function() {
$('#id_project').on('change', function()
{
var id_project = $('#id_project').val();
$.ajax(
{
url: "ff.php",
type: "POST",
data:{id_project},
dataType: "html",
success: function(data)
{
var datos = data.nb_informacion_general_localizacion;
alert(datos);
},
})
});
});
PHP
$id_project = $_POST['id_project'];
$sql = "bla bla bla";
while ($row = pg_fetch_assoc($result)) {
echo $row['id_project'];
echo $row['nb_informacion_general_localizacion'];
}