コード例 #1
0
    $acceptCharsetHeader = "Accept-Charset: " . mb_internal_encoding();
    header($acceptCharsetHeader);
    $head = "<html><head><meta http-equiv='Content-Type' content='text/html; charset=" . mb_http_output() . "'></head>";
    echo $head;
}
// Build connection object
//if ($connType == "MYSQL")
if ($_POST['Type'] == "MYSQL") {
    require "./mysql.php";
    $oConn = new MySqlConnection($_POST['ConnectionString'], $_POST['Timeout'], $_POST['Host'], $_POST['Database'], $_POST['UserName'], $_POST['Password']);
}
// Process opCode
if ($oConn) {
    $oConn->Open();
    if ($_POST['opCode'] == "IsOpen") {
        echo $oConn->TestOpen();
    } elseif ($oConn->connectionId && $oConn->isOpen) {
        if ($_POST['opCode'] == "GetTables") {
            echo $oConn->GetTables();
        } elseif ($_POST['opCode'] == "GetColsOfTable") {
            echo $oConn->GetColumnsOfTable($_POST['TableName']);
        } elseif ($_POST['opCode'] == "ExecuteSQL") {
            echo $oConn->ExecuteSQL($_POST['SQL'], $_POST['MaxRows']);
        } elseif ($_POST['opCode'] == "GetODBCDSNs") {
            echo $oConn->GetDatabaseList();
        } elseif ($_POST['opCode'] == "SupportsProcedure") {
            echo $oConn->SupportsProcedure();
        } elseif ($_POST['opCode'] == "GetProviderTypes") {
            echo $oConn->GetProviderTypes();
        } elseif ($_POST['opCode'] == "GetViews") {
            echo $oConn->GetViews();
コード例 #2
0
ファイル: MMHTTPDB.php プロジェクト: Izloko89/bichos
    if (!isset($oConn) || $oConn == false) {
        log_messages("\n" . 'MySQL Connection Object initialisation failed' . "\n\n" . @$error);
    } else {
        log_messages("\n" . 'MySQL Connection Object Created' . "\n\n");
    }
} else {
    $error = create_error('The files from the _mmServerScripts folder are for the server model PHP-MySQL. You try to connect to a database using a different server model ' . @$_POST['Type'] . ".\n\nPlease remove this folder outside the Dreamweaver environment on both local and testing machines and try again.", __LINE__);
    log_messages("\nError Sent:\n\n\t" . @$error . "\n\n\n");
    echo $error . '</HTML>';
    return;
}
// Process opCode
if (isset($oConn) && $oConn) {
    $oConn->Open();
    if ($_POST['opCode'] == 'IsOpen') {
        $answer = $oConn->TestOpen();
    } elseif (is_resource($oConn->connectionId) && $oConn->isOpen) {
        switch ($_POST['opCode']) {
            case 'GetTables':
                $answer = $oConn->GetTables(@$_POST['Database']);
                break;
            case 'GetColsOfTable':
                $answer = $oConn->GetColumnsOfTable(@$_POST['TableName']);
                break;
            case 'ExecuteSQL':
                $answer = $oConn->ExecuteSQL(@$_POST['SQL'], @$_POST['MaxRows']);
                break;
            case 'GetODBCDSNs':
                $answer = $oConn->GetDatabaseList();
                break;
            case 'SupportsProcedure':