Advertisement
humpda

DatabaseConnect

Mar 14th, 2022
1,065
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.34 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "teststudent2022";
  4. $password = "teststudent";
  5. $db = "teststudent2022_testdatabase";
  6.  
  7. $conn = mysqli_connect ($servername, $username, $password, $db);
  8.  
  9. if (!$conn) {
  10.     die ("Connection failed: = " . mysqli_connect_error());
  11.     }
  12. echo "connected successfully <br>";
  13.  
  14. mysqli_close($conn);
  15.  
  16. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement