Daftar dan Belajar Sekarang!

Menampilkan deskripsi berdasarkan id

foto simuf
23 Kontribusi 2 Coto
2 bulan yang lalu
gan agan, ane mau nanya nih ane mau nampilin deskripsi berdasarkan id tapi kenapa yang muncul selalu deskripsi pertama mulu ya? nampilinya pake modalview nih gan kode nya:
<div class="card">
                        <div class="card-header">
                            <h2>Services List
                            </h2>
                        </div>

                        <div class="table-responsive">
                            <table id="data-table-basic" class="table table-striped">
                                <thead>
                                <tr>

			                    <th>NO</th>
			                    <th>ID</th>
			                    <th>SERVICE</th>
			                    <th>STATUS</th>
			                    <th>DESKRIPSI</th>
			                    <th>ACTION</th>
			                  </tr>
			                </thead>
			                <tbody>
<?php
 $queryu = "SELECT * FROM service ORDER BY no ASC";
 $exe = mysql_query($queryu);
 $cek = mysql_num_rows($exe);
 $no = 1;
 while($row = mysql_fetch_assoc($exe)){
  $id = $row['no'];
  $service = $row['service'];
  $deskk = $row['description'];
  $status = $row['status'];
?>
			                  <tr>
			                    <td><?php echo $no; ?></td>
			                    <td><?php echo $id; ?></td>
			                    <td><?php echo $service; ?></td>
			                    <td><?php echo $status; ?></td>
			                    <td><a class="btn btn-sm btn-block btn-info waves-effect waves-light" data-toggle="modal" data-target="#deskripsii"> Deskripsi</a></td>
<div id="deskripsii" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
 <div class="modal-dialog">
  <div class="modal-content">
   <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h4 class="modal-title">Deskripsi Service</h4>
   </div>
    <div class="modal-body">
     <div class="form-group">
      <p> <?php echo $deskk; ?> </p>
     </div>
    </div>
			                    <td><a class="btn btn-sm btn-block btn-success waves-effect waves-light" href="?adminmenu=services&id=<?php echo $id; ?>"> Edit</a></td>
			                  </tr>
<?
$no++;
} ?>
makasih gan sebelumnya :)

Jawaban
foto verified logo bosque
121 Kontribusi 56 Coto
2 bulan yang lalu
Tambahkan where clause di querynya
$queryu = "SELECT * FROM service where id = 'id yg dicari'";

foto kanganjay08
28 Kontribusi 6 Coto
2 bulan yang lalu
sedikit rekomendesi Web


Login untuk diksusi di forum sekolah koding