Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // PHP databse config file for easy reusability
- $hostname = "localhost"; // Hostname to connect with
- $username = "username"; // Username for database
- $password = "password"; // Password for database
- // Create new object for the database connection and store it in a variable
- $conn = new mysqli($hostname, $username, $password);
- // If the connection is unsuccessful
- if (!$conn) {
- // Terminate the script
- die ("Connection failed: " . $conn->connect_error);
- }
- // Use database school
- mysqli_query($conn, "USE school");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement