コード例 #1
0
require_once dirname(__FILE__) . '/../base/ExceptionHandling/GlobalExceptionHandler.php';
require_once dirname(__FILE__) . '/../base/ExceptionHandling/ErrorToException.php';
require_once dirname(__FILE__) . '/../base/XML/XMLFactory.php';
require_once dirname(__FILE__) . '/../base/MySQL/SQLMediator.php';
function error_to_exception($code, $message, $file, $line, $context)
{
    if ($code != E_STRICT && $code != E_DEPRECATED) {
        throw new ErrorToException($code, $message, $file, $line, $context);
    }
}
set_error_handler("error_to_exception");
try {
    $mixId = $_POST['mixid'];
    $sql = new SQLMediator();
    $sql->connect();
    $mix = getMix($sql, $mixId);
    echo $mix;
    $sql->disconnect();
} catch (Exception $ex) {
    echo GlobalExceptionHandler::writeException($ex);
}
function getMix($sqlconn, $theMixId)
{
    $table = 'Mixes';
    $queryType = 'Select';
    $condition = array('MixId', $theMixId, 'text');
    $types = array('text');
    $columns = array('MixName');
    $values = array(null);
    $args = array('column' => $columns, 'value' => $values, 'type' => $types);
    $xml = createXML($table, $args);
コード例 #2
0
ファイル: GetMixId.php プロジェクト: benjiboybenjamin/you-mix
require_once dirname(__FILE__) . '/../base/ExceptionHandling/GlobalExceptionHandler.php';
require_once dirname(__FILE__) . '/../base/ExceptionHandling/ErrorToException.php';
require_once dirname(__FILE__) . '/../base/XML/XMLFactory.php';
require_once dirname(__FILE__) . '/../base/MySQL/SQLMediator.php';
function error_to_exception($code, $message, $file, $line, $context)
{
    if ($code != E_STRICT && $code != E_DEPRECATED) {
        throw new ErrorToException($code, $message, $file, $line, $context);
    }
}
set_error_handler("error_to_exception");
try {
    $mixName = $_POST['mixname'];
    $sql = new SQLMediator();
    $sql->connect();
    $id = getMix($sql, $mixName);
    echo $id;
    $sql->disconnect();
} catch (Exception $ex) {
    echo GlobalExceptionHandler::writeException($ex);
}
function getMix($sqlconn, $theMixName)
{
    $table = 'Mixes';
    $queryType = 'Select';
    $condition = array('MixName', $theMixName, 'text');
    $types = array('text');
    $columns = array('MixId');
    $values = array(null);
    $args = array('column' => $columns, 'value' => $values, 'type' => $types);
    $xml = createXML($table, $args);