我正試圖在此查詢中打開模態boostrap。我遇到的問題是當我點擊'更多信息'打開查詢的所有模式,並且我只想打開我點擊的所有模式。謝謝。如何在PHP查詢中打開twitter bootstrap模態
<?php
$consult= "SELECT * FROM `films`";
$result = $conexion -> query($consult);
if ($result) {
$cont3 = 0; //ID of the film
while ($nfila = $resultado -> fetch_object()) {
$film = "film".$cont3; //To make a unique ID to each film
echo "<form role='form' id='$film'>
<img src='images/".$nfila->image."'><br>
<h4>".$nfila->title." (".$nfila->year.")
<button type='button' class='btn btn-default' data-toggle='modal' data-target='.bs-example-modal-lg'>More Info</button></h4><br>
<div class='modal fade bs-example-modal-lg' tabindex='-1' role='dialog' aria-labelledby='myLargeModalLabel'>
<div class='modal-dialog modal-lg'>
<div class='modal-content'>
<div class='modal-header'>
<button tyle='button' class='close' data-dismiss='modal' aria-hidden='true'>×</button>
<h4 class='modal-tigle'>".$nfila->title."</h4>
</div>
<div class='modal-body'>
<img src='images/".$nfila->image."'><br>
<p><strong>Original Title: </strong>".$nfila->tituloOriginal."</p>
<p><strong>Year: </strong>".$nfila->anio."</p>
<p><strong>Country: </strong>".$nfila->pais."</p>
<p><strong>Sinopsis: </strong>".$nfila->sinopsis."</p>
</div>
<div class='modal-footer'>
<button type='button' class='btn btn-default' data-dismiss='modal'>Cerrar</button>
</div>
</div>
</div>
</div>
";
echo "</form>";
$cont3++;
}
} else {
echo "There was a error to load the films";
}
?>
使用連接到模態的div的'$ film' ID來針對特定的模式。 – Lee