Advertisement
Guest User

Untitled

a guest
Dec 4th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. <?php
  2. $user='root';
  3. $password='';
  4. $conn=mysqli_connect('localhost',$user,$password);
  5. mysqli_select_db($conn,'4iagr1');
  6. $result=mysqli_query($conn, "SELECT * FROM klienci");
  7. $num= mysqli_num_rows($result);
  8. echo '<form action="conn.php" method="POST">';
  9. while ($row=mysqli_fetch_assoc($result))
  10. {
  11. $id=$row['id'];
  12. $imie=$row['imie'];
  13. echo "$id $imie";
  14. echo "<input type='submit' name='XD$id' value='usun'><br>";
  15. $sql = "delete from klienci where id = $id";
  16. if (isset($_POST["XD$id"])) {
  17. mysqli_query($conn, $sql);
  18. }
  19. }
  20. echo '</form>';
  21. mysqli_close($conn);
  22. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement