TeguhSobari

data.php

Jun 10th, 2016
6,265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.82 KB | None | 0 0
  1. <?php
  2. include "Config.php";
  3. $query=mysql_query("select * from tbbarang");
  4. $jumlah=mysql_num_rows($query);
  5. echo "Jumlah data ada : ".$jumlah;
  6. ?>
  7. <table border="1" cellspacing="0">
  8. <tr>
  9. <th>KodeBarang</th>
  10. <th>NamaBarang</th>
  11. <th>HargaSatuan</th>
  12. </tr>
  13.  
  14. <?php
  15. while($row=mysql_fetch_array($query)){
  16. ?>
  17. <tr>
  18. <td><?php echo $row['KodeBarang'];?></td>
  19. <td><?php echo $row['NamaBarang'];?></td>
  20. <td><?php echo $row['HargaSatuan'];?></td>
  21. <td>
  22. <a href="delete.php?KodeBarang=<?php echo $row['KodeBarang']; ?>" onclick="return confirm('Apakah anda
  23. yakin?')"><img src="button-cross.gif" width="20" height="20" /></a>
  24. <a href="update.php?KodeBarang=<?php echo $row['KodeBarang']; ?>"><img src="button-edit.gif" width="20" height="20" /></a>
  25. </td>
  26. <?php
  27. }
  28. ?>
  29. </table><br />
  30. <a href="index.php">Tambah Data</a><br><br>
Add Comment
Please, Sign In to add comment