Advertisement
eyuprog

ntah lah

Jan 12th, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. //halaman lihatdata.php
  2. mysql_connect("host","user","root");
  3. mysql_select_db("db");
  4. $baca=mysql_query("Select * from siswa");
  5. while($row=mysql_fetch_array($baca))
  6. {
  7. echo '<a href="editsiswa.php?nis='".$row['nis']."'">Edit</a>';
  8. }
  9.  
  10. //halaman editsiswa.php
  11. <?php
  12. mysql_connect("host","user","root");
  13. mysql_select_db("db");
  14. if(isset($_GET['nis']))
  15. {
  16. ?>
  17. <form action="" method="post">
  18. <?php
  19. $baca=mysql_query("Select * from siswa Where $nis='".$_GET['nis']."'");
  20. $data=mysql_fetch_array($nis);
  21. ?>
  22. <input type="text" name="nis" value="<?=$data['nis'];?>">
  23. <input type="text" name="nama" value="<?=$data['nama'];?>">
  24. </form>
  25. <?php
  26. }
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement