當前位置: 首頁>>代碼示例>>PHP>>正文


PHP testdb函數代碼示例

本文整理匯總了PHP中testdb函數的典型用法代碼示例。如果您正苦於以下問題:PHP testdb函數的具體用法?PHP testdb怎麽用?PHP testdb使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了testdb函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testdb

    $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>";
開發者ID:manishkhanchandani,項目名稱:mkgxy,代碼行數:31,代碼來源:testdatabases.inc.php

示例2: runsql

<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>");
開發者ID:pietersartain,項目名稱:webtools,代碼行數:31,代碼來源:install.php

示例3: testdb

<?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;
}
開發者ID:Takeya-Yuki-Studio,項目名稱:Yuki-Auth-Login,代碼行數:19,代碼來源:testdb.php

示例4: testdb

                <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);
開發者ID:dunghand,項目名稱:lamansion_2,代碼行數:30,代碼來源:chat.php


注:本文中的testdb函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。