Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. $dbServer = 'localhost';
  5. $dbUser = 'root';
  6. $dbPassword = '';
  7. $dbName = 'klient';
  8.  
  9. $connection = new mysqli($dbServer, $dbUser, $dbPassword, $dbName);
  10.  
  11. $sql = "CREATE TABLE users(
  12. id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
  13. username VARCHAR(20) NOT NULL,
  14. email VARCHAR(100) NOT NULL)
  15. ;";
  16.  
  17. if($connection ->query($sql) === TRUE){
  18. echo "Utworzono tabele";
  19. }
  20.  
  21. else { echo "nie udało się".$connection->error ;
  22. }
  23. $connection->close();
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement