使用我的SQL Select,我讓我的每個(gè)表行在我的html表標(biāo)記中正確顯示,正如您在圖像中看到的那樣。然而,當(dāng)我在每一行中單擊我的模態(tài)標(biāo)簽時(shí),它只回顯整個(gè)表格中的第一行,在這種情況下,“cat1_tagname脊醫(yī)”。不知道為什么它沒有回聲基于每個(gè),尋找解決方案。我試圖在模態(tài)標(biāo)簽內(nèi)添加我的foreach:,但它在點(diǎn)擊時(shí)會(huì)顯示每一個(gè)。<?php foreach($lstTagMain as $rowTagOne) { ?><?php foreach($lstTagMain as $rowTagOne) { ?> <tr class="text-center"> <td class="col-md-1"> <a href="category-coupon-list.php?c=1&c1=<?php echo($rowTagOne['product_cat1id']); ?>&c2=0&c3=0&t1=<?php echo($rowTagOne['cat1_tagname']); ?>&t2=0&t3=0"><img src="img/icon-add.png"></a> </td> <td class="col-md-1"> <img src="img/icon-edit.png" data-toggle="modal" data-target="#category-edit-one"> <div id="category-edit-one" class="modal fade" role="dialog"> <div class="modal-dialog"> <div class="modal-content address-modal"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">×</button> <h4 class="modal-title text-center"><?php echo($rowTagOne['cat1_tagname']); ?></h4> </div> <div class="modal-body"> <form method="post" enctype="multipart/form-data"> <div class="row"> <div class="col-md-12"> <input type="text" class="form-control" value="<?php echo($rowTagOne['cat1_tagname']); ?>" name="cat1_tagname" placeholder="Edit Category 1 Name"> </div> <div class="col-md-12"><hr></div>
PHP 對(duì)于每個(gè)未顯示在模式彈出窗口中的 PHP
幕布斯7119047
2022-08-19 15:14:19