如何获取表中的特定行并显示为视图模式?

时间:2018-10-08 15:54:26

标签: php bootstrap-modal

我是新来的!我目前正在使用具有编辑和删除功能的表,而我正在使用模态的表。现在我在查看功能上遇到了麻烦。即时通讯使用下面显示的代码。它显示数据库中的所有数据,而不是特定的数据。有人可以帮助我指出我的编码错误吗?下面是我的UI图片。谢谢,天哪

enter image description here

enter image description here

<!-- Modal view-->
     <div class="modal fade" id="myModal" role="dialog">
        <div class="modal-dialog">
     <!-- Modal content-->
          <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title"><img src="user.png" width="50px" height="50px" id="blah" class="img-rounded"> Patient Information</h4>
              <button type="button" class="close" data-dismiss="modal">&times;</button>
            </div>
            <div class="modal-body">

 <?php

          $patient_id="";

              include("db.php");
                $q = mysqli_query($conn,"SELECT
FROM
patient
WHERE
patient.patient_id - '$patient_id'");
                  while($row = mysqli_fetch_array($q)){
                    echo 
                    'Fullname: &nbsp; ' . $row['lname'] .',&nbsp; ' . $row['fname'] . '&nbsp;' . $row['mi'] . '.&nbsp;' . $row['suffix'] . '<br>
                    Gender: &nbsp;' . $row['sex'] . '<br>
                    Birthday: &nbsp;' . $row['birthdate'] . '<br>
                    Marital Status: &nbsp;' . $row['marital_stat'] . '<br>
                    Contact No: &nbsp;' . $row['contact_no'] . '<br>
                    Baranggay: &nbsp;' . $row['baranggay'] . ',&nbsp;' . $row['city_municipal'] . ',&nbsp;' . $row['province'] . ' ' ;

              }
            ?>



                        </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
          </div>

        </div>
      </div>

0 个答案:

没有答案