+ 1
How should I link my php file to my database?
2 Answers
+ 7
use
$servername =Â "localhost";
$username =Â "username";
$password =Â "password";
// Create connection
$conn =Â new mysqli($servername, $username, $password);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}Â
echo "Connected successfully";
- 2
mysql-connect('localhost','root,'');