Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>Basic CRUD PHP</title>
  4. </head>
  5. <body>
  6. <?php
  7.  
  8. ini_set('display_errors', 1);
  9. error_reporting(~0);
  10.  
  11. $serverName = "localhost";
  12. $userName = "root";
  13. $userPassword = "";
  14. $dbName = "database";
  15.  
  16. $conn = mysqli_connect($serverName,$userName,$userPassword,$dbName);
  17.  
  18. if (mysqli_connect_errno())
  19. {
  20. echo "Database Connect Failed : " . mysqli_connect_error();
  21. }
  22. else
  23. {
  24. echo "Database Connected.";
  25. }
  26.  
  27. mysqli_close($conn);
  28. ?>
  29. </body>
  30. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement