本文整理汇总了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>";
示例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>");
示例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;
}
示例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);