I explain: I have a modal that opens by means of a tag, at the time of clicking, it does not show the results of the sql statement.
I make the connection to the database in the head. I save a data from a previous query to be able to make another query with that data. At the moment of showing the results, the modal opens to me empty. I would greatly appreciate your help.
//se genera un botón por cada registro
<td><a whatever='@fat' data-toggle='modal' class='btn btn-success' data-target='#visual$row[IDresguardo]'><i class='fa fa-eye'></i> Ver Registros</a></td></tr>
// modal
<div class="modal fade" id="visual<?php echo $row['IDresguardo'];?>" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div style="background-color: #4E9C3D;" class="modal-header bg-primary">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title " id="myModalLabel"> <label>mostrar registros de BD</label></h4>
</div>
<div class="modal-body">
<?php
$fecha1=$row[fecha];
$mostrarc=mysql_query("select r.fecha, r.tipo, hi.cantidad ,h.descripcionB from herramienta h, historial hi, resguardo r where hi.NoHerramienta=h.NoHerramienta and hi.RPEtrab='.$rpe.' and r.fecha='.$fecha1.'");
echo "<table>";
echo "<tr>";
echo "<th>fech</th>";
echo "<th>tipo</th>";
echo "<th>Cantidad</th>";
echo "<th>descripcionB</th>";
echo "</tr>";
while ($row = mysql_fetch_row($mostrarc)) {
echo "<tr>";
echo "<td>".$row[0]."</td>";
echo "<td>".$row[1]."</td>";
echo "<td>".$row[2]."</td>";
echo "<td>".$row[3]."</td>";
echo "</tr>";
}
echo "</table>";
?>
</div>
</div>
</div>
</div>