<?php
$table_check = run_query('SHOW TABLES LIKE "' . $config["table_prefix"] . 'key"');
if (sql_num_rows($table_check)) {
    $result = run_query('SELECT code FROM ' . $config["table_prefix"] . 'key');
    if ($row = sql_fetch_assoc($result)) {
        $file_path = $config['site_path'] . '/runtime/key.php';
        file_put_contents($file_path, $row['code']);
        unset($file_path);
    }
}