$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(); } elseif ($_POST['opCode'] == "GetProcedures") { echo $oConn->GetProcedures(); } elseif ($_POST['opCode'] == "GetParametersOfProcedure") { echo $oConn->GetParametersOfProcedure($_POST['ProcName']); } elseif ($_POST['opCode'] == "ReturnsResultset") { echo $oConn->ReturnsResultSet($_POST['RRProcName']); } elseif ($_POST['opCode'] == "ExecuteSP") { echo $oConn->ExecuteSP($_POST['ExecProcName'], 0, $_POST['ExecProcParameters']); } elseif ($_POST['opCode'] == "GetKeysOfTable") {
$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': $answer = $oConn->SupportsProcedure(); break; case 'GetProviderTypes': $answer = $oConn->GetProviderTypes(); break; case 'GetViews': $answer = $oConn->GetViews(@$_POST['Database']); break; case 'GetProcedures': $answer = $oConn->GetProcedures(@$_POST['Database']); break; case 'GetParametersOfProcedure': $answer = $oConn->GetParametersOfProcedure(@$_POST['ProcName']);