Guest User

Untitled

a guest
Sep 11th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. <html>
  2. <body><?php session_start();
  3. require_once "config.php";
  4. $connect = @new mysqli($host, $db_user, $db_password, $db_name);
  5. if ($connect->connect_errno!=0)
  6. {
  7. echo "Error: ".$connect->connect_errno;
  8. mysql_query('SET NAMES utf8');
  9. mysql_query('SET CHARACTER_SET utf8_general_ci');
  10.  
  11. }?>
  12. <head>
  13. <meta http-equiv="content-type" content="text/html; charset=utf-8">
  14. </head>
  15. <form method="get" action="">
  16. BAZA<input type="text" name="baza"/>
  17. CO<input type="text" name="co"/>
  18. GDZIE
  19. <input type="text" name="warunek"/>
  20. <input type="submit">
  21. </form>
  22. UPDATE nazwa_bazy SET atrybut='wartosc' WHERE warunek='wartosc'")
  23. <pre>
  24. <?php
  25. if (isset($_get) && empty($_POST) == false){
  26. $baza = $_get['baza'];
  27. $co = $_get['co'];
  28. $warunek = $_get['warunek'];
  29. mysqli_query($connect,"UPDATE $baza SET $co WHERE $warunek");
  30. var_dump($_POST);
  31.  
  32. }
  33. ?>
  34. </body>
  35. </html>
Add Comment
Please, Sign In to add comment