/**
 * Gets the query nr $index from the Sql-Library.
 *
 * @param integer $index
 * @return string
 */
function getQueryFromSqlLibrary($index)
{
    global $SQL_ARRAY;
    if (!is_array($SQL_ARRAY)) {
        getSqlLibrary();
    }
    if (isset($SQL_ARRAY[$index]) && !empty($SQL_ARRAY[$index])) {
        $s = explode('|', $SQL_ARRAY[$index], 2);
        return isset($s[1]) ? $s[1] : '';
    } else {
        return '';
    }
}
<?php

/**
 * This file is part of MySQLDumper released under the GNU/GPL 2 license
 * http://www.mysqldumper.net
 *
 * @package         MySQLDumper
 * @version         SVN: $rev: 1207 $
 * @author          $Author$
 * @lastmodified    $Date$
 */
if (!defined('MSD_VERSION')) {
    die('No direct access.');
}
getSqlLibrary();
if (isset($_POST['save'])) {
    if (count($databases) > 0) {
        $i = 0;
        foreach ($databases as $dbName => $val) {
            $databases[$dbName]['prefix'] = '';
            if (isset($_POST['dbpraefix_' . $i])) {
                $databases[$dbName]['prefix'] = $_POST['dbpraefix_' . $i];
            }
            $databases[$dbName]['command_before_dump'] = '';
            if (!empty($_POST['command_before_' . $i])) {
                $databases[$dbName]['command_before_dump'] = getQueryFromSqlLibrary($_POST['command_before_' . $i]);
            }
            $databases[$dbName]['command_after_dump'] = '';
            if (!empty($_POST['command_after_' . $i])) {
                $databases[$dbName]['command_after_dump'] = getQueryFromSqlLibrary($_POST['command_after_' . $i]);
            }