The default MySQL port is 3306 so keep that value (unless you have changed the port in your MySQL installation).
As far as I can see there are no extra backticks in the SQL commands. Your _db.php should start like this:
<?php
// this should point to your MySQL server instance:
$host = "127.0.0.1";
$port = 3306;
$username = "root";
$password = "";
$database = "doctor";
$db = new PDO("mysql:host=$host;port=$port",
$username,
$password);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// other init
date_default_timezone_set("UTC");
session_start();
$db->exec("CREATE DATABASE IF NOT EXISTS `$database`");
$db->exec("use `$database`");