Advertisement
Guest User

Untitled

a guest
Sep 14th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.74 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>Edycja</title>
  4. </head>
  5. <body>
  6. <h1> Edycja danych</h1>
  7. <?php
  8.  
  9. $id2=$_POST['id2'];
  10. $im2=$_POST['im2'];
  11. $na2=$_POST['na2'];
  12.  
  13.  
  14. $dbname = postgres;
  15. $user = postgres;
  16. $pass = retro2retro;
  17.  
  18.  
  19. $dbh = pg_connect("dbname=$dbname user=$user
  20. password=$pass host=localhost") or die("Nie moge
  21. polaczyc sie z baza danych !");
  22.  
  23.  
  24. $query = "UPDATE klient SET imie='$im2', nazwisko='$na2'
  25. where id_kilenta='$id2';";
  26. $wynik = pg_query($query);
  27.  
  28. //sprawdzmy ile wierszy podmieniono
  29. $lz = pg_affected_rows($wynik);
  30. echo "Edytowano $lz osob <br /> \n";
  31. pg_close($dbh);
  32.  
  33. // zapewnijmy powrot do strony poprzedniej
  34. echo "<form action=index.php method=post>
  35. <input type=submit name=Ok value=OK>
  36. </form>";
  37. ?>
  38. </body>
  39. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement