Running the ajax throws the POST 500 error. The php throws the problem if I define $columna= $_POST['columna'];
but if I define by test $columna='marca';
the PHP works correctly and sends the information to ajax correctly. So I guess the problem is in what Ajax sends and how PHP gets it.
function traer( id )
{
$.ajax({
url: '../server/info.php',
dataType: "json",
cache: false,
processData: false,
contentType: false,
data: { id: id },
type: 'POST',
success: (data) =>{
$( "#" + id ).html( data );
},
error: function(){
alert( "Error con el servidor" );
}
})
}
document.getElementById("marca").onclick=function(event){traer("marca");};