1<?php
2$servername = "localhost";
3$username = "username";
4$password = "password";
5$dbname = "myDB";
6
7// Create connection
8$conn= mysqli_connect($servername,$username,$password,$dbname);
9// Check connection
10if (!$conn) {
11 die("Connection failed: " . mysqli_connect_error());
12}
13echo "Connected Successfully.";
14?>
1<?php
2$servername = "localhost";
3$username = "username";
4$password = "password";
5
6// Create connection
7$conn = new mysqli($servername, $username, $password);
8
9// Check connection
10if ($conn->connect_error) {
11 die("Connection failed: " . $conn->connect_error);
12}
13echo "Connected successfully";
14?>