<?php
$link = new mysqli('localhost', 'root', '', 'ddfichain');
if ($link->connect_error) {
    die('CONNECT_ERROR: ' . $link->connect_error);
}
$res = $link->query("SHOW COLUMNS FROM settings LIKE 'site_logo'");
if ($res === false) {
    die('QUERY_ERROR: ' . $link->error);
}
if ($res->num_rows === 0) {
    if ($link->query("ALTER TABLE settings ADD COLUMN site_logo varchar(255) DEFAULT NULL AFTER site_phone")) {
        echo 'added';
    } else {
        die('ALTER_ERROR: ' . $link->error);
    }
} else {
    echo 'already_exists';
}
$link->close();
