Create data base in php
here is your Code:
<?php
$servername = "localhost";
$username = "root";
$password = "";
try {
$conn = new pdo("mysql:host=$servername", $username, $password);
$conn->setAttribute(pdo::ATTR_ERRMODE, pdo::ERRMODE_EXCEPTION);
$sql = "CREATE database account";
$conn->exec($sql);
echo "database account create successfully";
} catch (PDOException $e) {
echo $sql . "<br>" . $e->getMessage();
}
$conn = null;
here, we create data base in php and run on localhost if database create the localhost will show connect successfully message
if you have still doubt please see out video:
wah wah
ReplyDelete