I need to retrieve parameter sent to a modal bootstrap, perform a query in the database and show result in a text field for the user, what I have is this:
Sending the parameter to the modal
<i class="icon-large icon-book" onclick="VerComentario()" IdCandidato=<?php echo $IdCandidato; ?>></i>
The modal call
// Chamada da janela modal para ver o Comentário
function VerComentario() {
$("#VerComentario").modal({
backdrop: false
});
$("#VerComentario .modal-header h3").html("Observação Cadastrada");
$("#VerComentario").modal("show");
}
In the modal I have this SQL
<?php
$IdCandidato = $_GET['IdCandidato'];
require_once('../Connections/conCurriculoCocari.php');
$query = "SELECT * FROM observacao WHERE id_candidato = $IdCandidato ";
$result = mysql_query($query) or die ('Error (' . mysql_errno() . ') ' . mysql_error());
?>
But the parameter is not being sent, I need to receive the same, send to the modal to make the select and show the result to the user