trim((string)($_POST['sqlHost'] ?? '127.0.0.1')),
'sqlUser' => trim((string)($_POST['sqlUser'] ?? '')),
'sqlPassword' => (string)($_POST['sqlPassword'] ?? ''),
'sqlDatabase' => trim((string)($_POST['sqlDatabase'] ?? '')),
));
$tested = true;
$link = install_connect($connect);
if ($link === null) {
install_error('Could not connect: ' . ih((string)$connect));
} else {
$tables = install_server_tables($link);
$link->close();
if (!$tables['ok']) {
install_error(
'Connected, but this database has no accounts / players tables. '
. 'Import your server\'s own schema.sql first, then come back.'
);
} elseif (!empty($_POST['continue'])) {
install_max_step(3);
header('Location: ' . install_url(3));
exit;
}
}
}
// Pre-fill from config.php so a normal install is mostly clicking Next.
$saved = install_saved_config();
$value = static function (string $key, string $fallback = '') use ($saved) {
$fromState = install_get($key, null);
if ($fromState !== null && $fromState !== '') {
return (string)$fromState;
}
return (string)($saved[$key] ?? $fallback);
};
?>
The same database your Open Tibia server uses. ZnoteX adds its own
znote_* tables beside the server's.