Untitled
Anonymous
php
06/04/2022 7:10 PM
572 B
21
Indexable
<?php
$servername = "127.0.0.1";
$username = "root";
$password = "<password-here>";
$database = "crud";
try {
$conn = new PDO("mysql:host=$servername;dbname=$database", $username, $password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
echo "Connection failed: " . $e->getMessage();
}
?>Editor is loading...