+ 1
How should I link my php file to my database?
2 Réponses
+ 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,'');