当前位置: 首页>>代码示例>>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;未经允许,请勿转载。