簡體   English   中英

如何在彈出窗口中顯示php mysql select value

[英]How to display php mysql select value in popup

我想將mysql選擇值(UID)傳遞給css popup。這是我嘗試過的代碼。但是它顯示為空的文本框。單擊刪除按鈕時此彈出按鈕顯示。我想將相關的用戶UID傳遞給彈出窗口。

    <table  class="table table-striped table-bordered responsive">
                            <thead>
                            <tr>
                                <th>User ID</th>
                                <th>Facebook ID</th>
                                <th>Name</th>
                                <th>E-mail</th>
                                <th></th>

                            </tr>
                            </thead>
                            <tbody>
                              <tr>  
                          <?php

                        $query = 'SELECT * FROM Users ';
                        $result = mysql_query($query);
                        while($row = mysql_fetch_assoc($result))
                            {   

                            echo '<tr>';
                            echo '<td>'.$row['UID'].'</td>';
                            echo '<td  class="center">'.$row['Fuid'].'</td>';
                echo '<td class="center">'.$row['Ffname'].'</td>';
                echo '<td  class="center">'.$row['Femail'].'</td>';
                echo '<td>'.'<a href="#" class="btn btn-info btn-setting" >'.'Delete'.'</a>'.'</td>';
                echo '</tr>';   
                }                           
                ?>
                </tr>
                 </tbody>
                  </table>

 <form action="db_sql/db_delete_supplier.php" method="post" name="frm1" id="frm1" >
        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
             aria-hidden="true">

            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal">×</button>
                        <h3>Delete Supplier</h3>
                    </div>
                    <div class="modal-body">
                      <p>Are you sure to delete this supplier from system ...? </p>
                    </div>
                    <div class="modal-footer">
                    <input type="text" name="UID" value="<?php echo $row['UID'];?>" />
                        <!--<a href="user.php" class="btn btn-default" data-dismiss="modal" name="no">Close</a>
                        <a href="db_sql/db_delete_supplier.php" class="btn btn-primary" data-dismiss="modal" name="yes">Delete</a>-->
                        <input type="submit" class="btn btn-default" name="no" value="Close" />
                         <input type="submit" class="btn btn-primary" name="yes"  value="Delete"/>
                    </div>
                </div>
            </div>
        </div>
    </form>

用戶表

<?php echo "<a href=\"popup.php?cat_id=".$row["cat_id"]." \">Edit</a>"; ?>

將此代碼放入While循環中,這樣將打開帶有cat-id的查詢字符串的彈出窗口。

現在,您可以從該ID中獲取彈出窗口中的所有記錄。

這是您可以做的可能的解決方案。

注意:您可以傳遞任何唯一的ID,以便您可以在彈出頁面上執行選擇查詢,它將從數據庫中獲取數據

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM