$myDSN = "PROVIDER=MSDASQL;DRIVER={SQL Server};" . "SERVER={$server};DATABASE=NorthWind;UID=adodb;PWD=natsoft;Trusted_Connection=No"; if ($db->PConnect($myDSN, "", "", "")) { testdb($db, "create table ADOXYZ (id int, firstname char(24) null, lastname char(24) null,created datetime null)"); } else { print "ERROR: MSSQL test 2 requires MS SQL 7"; } } if (!empty($testmssql) && !empty($testado)) { // ADO ACCESS MSSQL with OLEDB provider $db = ADONewConnection("ado_mssql"); print "<h1>Connecting DSN-less OLEDB Provider {$db->databaseType}...</h1>"; //$db->debug=1; $myDSN = "SERVER=localhost;DATABASE=northwind;Trusted_Connection=yes"; if ($db->PConnect($myDSN, "adodb", "natsoft", 'SQLOLEDB')) { testdb($db, "create table ADOXYZ (id int, firstname char(24), lastname char(24),created datetime)"); } else { print "ERROR: MSSQL test 2 requires a MS SQL 7 on a server='mangrove', userid='sa', password='', database='ai'"; } } if (extension_loaded('odbtp') && !empty($testmssql)) { // MS SQL Server via ODBC $db = ADONewConnection('odbtp'); $dsn = "PROVIDER=MSDASQL;Driver={SQL Server};Server={$server};Database=northwind;uid=adodb;pwd=natsoft"; if ($db->PConnect('localhost', $dsn, "", "")) { print "<h1>Connecting {$db->databaseType}...</h1>"; testdb($db, "create table ADOXYZ (id int, firstname char(24) null, lastname char(24) null,created datetime null)"); } else { print "ERROR: MSSQL test 1 requires a MS SQL 7 server setup with DSN setup"; } } print "<h3>Tests Completed</h3>";
<br /> <h4>Current tables</h4> <?php runsql($db, $udb, "SHOW TABLES"); ?> <br /><br /> <form action="?typ=execute" method="post"> <input size=50 type=text name="query"><input type=submit> </form> <?php break; case "test": testdb($db, $udb); break; case "install": install($db, $udb, $_GET["file"], $dbinfo); break; case "backup": if (!backup($dbinfo)) { printf("Backup failed. Cowardly refusing to continue.<br><a href='?typ=forms'>Return</a>"); return; } else { printf("Backup completed. Nice. <br><a href='?typ=forms'>Return</a>"); } break; case "delete": if (!backup($dbinfo)) { printf("Backup failed. Cowardly refusing to continue.<br><a href='?typ=forms'>Return</a>");
<?php include_once $_SERVER["DOCUMENT_ROOT"] . "/include/common/mui.php"; include_once $_SERVER["DOCUMENT_ROOT"] . "/include/common/enum_values.php"; function testdb() { $con = mysqli_connect($_POST["server"], $_POST["user"], $_POST["password"], $_POST["database"], $_POST["port"]); if ($con != false) { mysqli_close($con); return dberror::OK; } else { return dberror::CONNECT_EXCEPTION; } } if (testdb() == dberror::OK) { echo install::dbok; } else { echo install::dbfail; }
<hr style="color:#ccc;"> <div class="form-group"> <div class="panel-title"><b>Send to list</b></div> <input type="text" class="col-xs-12 form-control" value="User1,User2"> <textarea class="col-xs-12 form-control" rows="5" style="margin: 10px 0px;"> Chat Content </textarea> <button class="col-xs-12 btn" style="padding: 10px;margin-bottom: 20px;">Send</button> </div> </div> </div> </section><!-- /.content --> <script src="js/calendar.js"></script> <script> $("#chat").addClass("active"); </script> </div> <?php include_once "footer.php"; ?> <?php $b = testdb(); print_r($b);