Pomoc oko mysql baze

Treba mi pomoc oko ubacivanja mysql baze preko php fajla.
Nikako ne mogu da uploadujem bazu, ako neko zna kako neka napise.
Kod php fajla počinje ovako

    <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<?php
error_reporting(E_ALL);
define('DB_DSN', 'mysql:host=localhost;');
define('DB_DSN_NEW', 'mysql:host=localhost;dbname=livescore');
define('DB_LOGIN', 'last');
define('DB_PASSWORD', '475730');
$flag = 0;
class CreateDBStructure {
private $pdo;
private $pdo1;
public function __construct(PDO $pdo) {
$this->pdo = $pdo;
}
public function deleteDB() {
$deleteDB = "DROP DATABASE livescore";
$delete_pdo = new PDO(DB_DSN, DB_LOGIN, DB_PASSWORD);
if ($delete_pdo->exec($deleteDB)) echo "<div style='color:green'>База данных успешно удалена</div>";
else throw new PDOException("<div style='color:res'>Невозможно удалить базу данных</div>");
}
public function createDB() {
$createDB = "CREATE DATABASE IF NOT EXISTS livescore";
if ($this->pdo->query($createDB)) echo "<div style='color:green'>База данных успешно создана</div>";
else throw new PDOException("<div style='color:res'>Невозможно создать базу данных</div>");
$this->pdo = null;
$this->pdo1 = new PDO(DB_DSN_NEW, DB_LOGIN, DB_PASSWORD);
}
public function createTableContinents() {
$continents = "CREATE TABLE IF NOT EXISTS continents (
id_continent tinyint(2) primary key auto_increment,
name varchar(100) NOT NULL)";
if ($this->pdo1->query($continents)) $this->successToCreate("continents");
else throw new PDOException($this->unnableToCreate("continents"));
}
public function createTableCountries() {
$countries = "CREATE TABLE IF NOT EXISTS countries (
id_country tinyint(3) primary key auto_increment,
name varchar(100) NOT NULL, emblem varchar(200) NOT NULL, id_continent tinyint(2) NOT NULL)";
if ($this->pdo1->query($countries)) $this->successToCreate("countries");
else throw new PDOException($this->unnableToCreate("countries"));

Copyright © 2020 WM Forum - AboutContact - Sponsored by: Mydataknox & Webmaster.Ninja