Ideally you just get the ID of each record from your table and do an Ajax to get the other results. As you are already using jQuery, you would need to do an ajax on some PHP that queries those values and returns.
function getInfoById(meu_id){
$.ajax({
type:'GET',
dataType: 'json',
url: 'getDados.php',
data: {
id: meu_id
}
success: function(dados){
$("#resultados").html("Nome: " + dados.nome + ", idade: " + dados.idade);
}
});
}
After receiving the ID parameter and making the query, you return the result in JSON using json_encode . By getting this information object from that single record, you can already use it to create the modal or display elsewhere quietly with jQuery, as in the example above.
Here are examples of working with Ajax and PHP together: