passing selected datarow into modal bootstrap

后端 未结 1 526
说谎
说谎 2021-01-07 09:12

I have a table which has a button in each row to show details of each record. what I need is to pass selected data row to modal.

here is my PHP code for display dat

1条回答
  •  时光说笑
    2021-01-07 10:07

    What you need is an Ajax call inside $('#detail').on('show.bs.modal', function (e) { } to fetch data against $row['id_site']

     
    

    file.php

    query($sql);
        if($result->num_rows > 0){
        while ($row = $result->fetch_assoc()) {
            echo "
    ID Site : $row[id_site]
    Nama Site : $row[name_site]
    Witel : $row[witel]
    OLT Hostname : $row[olt]
    IP OLT : $row[ip_olt]
    Port OLT : $row[port_olt]
    IP ONT : $row[ip_ont]
    "; } } } ?>

    0 讨论(0)
提交回复
热议问题