Advertisement
Guest User

Untitled

a guest
May 6th, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. <?php
  2.  
  3. function pobierzBaze() {
  4. static $conn = null;
  5. if( $conn ) {
  6. return $conn;
  7. }
  8.  
  9. $servername = "mysql.agh.edu.pl";
  10. $username = "typerw";
  11. $password = "wiktoria";
  12. $database = "typerw";
  13.  
  14. $conn = new mysqli($servername, $username, $password, $database);
  15. return $conn;
  16. }
  17.  
  18. function Dodaj($nazwa, $email, $haslo, $status){
  19. $sql = "INSERT INTO `typerw`.`bazadanych`(`id`, `nazwa`, `email`, `haslo`, `status`) VALUES (NULL, $nazwa, $email, $haslo, $status)";
  20. $db = pobierzBaze();
  21. return $db->query($sql);
  22. }
  23. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement