当前位置: 首页>>代码示例>>PHP>>正文


PHP OpenDB函数代码示例

本文整理汇总了PHP中OpenDB函数的典型用法代码示例。如果您正苦于以下问题:PHP OpenDB函数的具体用法?PHP OpenDB怎么用?PHP OpenDB使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了OpenDB函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: OpenApp

function OpenApp($title)
{
    $_retval = false;
    if (!OpenDB()) {
        return $_retval;
    }
    if (!empty($title)) {
        AppHeader($GLOBALS['appName'] . "-" . $title);
    }
    $GLOBALS['accessRights'] = "rw";
    // CHECK APPLICATION SECURITY HERE  (in this example, "r" gives read-only access and "rw" gives read/write access)
    if (empty($GLOBALS['accessRights']) || !isset($GLOBALS['accessRights']) || substr($GLOBALS['accessRights'], 0, 1) != "r") {
        echo "<p class='error'>You do not have permission to access this application";
    } else {
        $_retval = true;
    }
    return $_retval;
}
开发者ID:retnan,项目名称:TrunkSMS,代码行数:18,代码来源:applib.php

示例2: OpenDB

#detail {
  height:100%;
  width:70%;
  float:left;
  border: 1px solid #EEE;
}
</style>
</head>

<body>

<div id='tablist'>
<p><strong>Rico Raw Data Viewer</strong>
<?php 
require "applib.php";
OpenDB();
DisplaysObjects("TABLE");
DisplaysObjects("VIEW");
CloseApp();
function DisplaysObjects($ObjType)
{
    global $oDB;
    $arTables = $oDB->GetTableList($ObjType);
    echo "<p><strong>" . $ObjType . "S</strong>";
    if (!is_array($arTables)) {
        return;
    }
    echo "<ul>";
    foreach ($arTables as $tabName) {
        echo "<li><a href='RicoDbViewerDetail.php?id=" . $tabName . "' target='detail'>" . $tabName . "</a>";
    }
开发者ID:retnan,项目名称:TrunkSMS,代码行数:31,代码来源:RicoDbViewer.php

示例3: array

<html>
<head>
<title>Rico-Table Detail</title>

<script src="../../src/min.rico.js" type="text/javascript"></script>
<link href="../../src/css/min.rico.css" type="text/css" rel="stylesheet" />
<link href="../../src/css/greenHdg.css" type="text/css" rel="stylesheet" />
<link href="../client/css/demo.css" type="text/css" rel="stylesheet" />

<?php 
require "applib.php";
require "chklang2.php";
$arColumns = array();
$columnlist = "";
$colspecs = "";
if (isset($_GET["id"]) && OpenDB()) {
    $id = trim($_GET["id"]);
    $arColumns = $oDB->GetColumnInfo($id);
    for ($i = 0; $i < count($arColumns); $i++) {
        if (!empty($columnlist)) {
            $columnlist .= ",";
            $colspecs .= ",";
        }
        $columnlist .= $arColumns[$i]->ColName;
        $colspecs .= "{Hdg:'" . $arColumns[$i]->ColName . "'";
        if ($arColumns[$i]->ColType == "DATETIME") {
            $colspecs .= ",type:'datetime'";
        }
        $colspecs .= "}";
    }
    $_SESSION[$id] = "select " . $columnlist . " from " . $id . "";
开发者ID:retnan,项目名称:TrunkSMS,代码行数:31,代码来源:RicoDbViewerDetail.php

示例4: header

header("Cache-Control: no-cache");
header("Pragma: no-cache");
header("Expires: " . gmdate("D, d M Y H:i:s", time() + -1 * 60) . " GMT");
header("Content-type: text/xml");
echo "<?xml version='1.0' encoding='iso-8859-1'?>\n";
require "applib.php";
require "../../plugins/php/ricoXmlResponse.php";
$id = isset($_GET["id"]) ? $_GET["id"] : "";
$parent = isset($_GET["Parent"]) ? $_GET["Parent"] : "";
echo "\n<ajax-response><response type='object' id='" . $id . "_updater'>";
if ($id == "") {
    echo "\n<rows update_ui='false' /><error>";
    echo "\nNo ID provided!";
    echo "\n</error>";
} elseif (!OpenDB()) {
    echo "\n<rows update_ui='false' /><error>";
    echo "\n" . htmlspecialchars($oDB->LastErrorMsg);
    echo "\n</error>";
} else {
    $oDB->DisplayErrors = false;
    $oDB->ErrMsgFmt = "MULTILINE";
    $oXmlResp = new ricoXmlResponse();
    echo "\n<rows update_ui='true' offset='0'>";
    if ($parent) {
        $oXmlResp->Query2xmlRaw("SELECT '{$parent}',CustomerID,CompanyName,'L',1 FROM customers where CompanyName like '{$parent}%'", 0, 99);
    } else {
        $oXmlResp->WriteTreeRow("", "root", "Customer names starting with...", "C", 0);
        $oXmlResp->Query2xmlRaw("SELECT distinct 'root',left(CompanyName,1),left(CompanyName,1),'C',0 FROM customers", 0, 99);
    }
    print "\n" . "</rows>";
开发者ID:modulexcite,项目名称:frameworks,代码行数:30,代码来源:CustTree.php

示例5: while

$grid->AddHeadingRow(false);
$grid->AddCell("ID");
$grid->AddCell("ID");
$grid->AddCell("Shipment");
$grid->SetCellAttr("colspan", 3);
$grid->AddCell("Date");
$grid->SetCellAttr("colspan", 2);
$grid->AddHeadingRow(true);
$grid->AddCell("Order");
$grid->AddCell("Customer");
$grid->AddCell("Name");
$grid->AddCell("City");
$grid->AddCell("Country");
$grid->AddCell("Order");
$grid->AddCell("Ship");
if (OpenDB()) {
    $sqltext = "select OrderID,CustomerID,ShipName,ShipCity,ShipCountry,OrderDate,ShippedDate from orders order by OrderID";
    $rsMain = $oDB->RunQuery($sqltext);
    $colcnt = $oDB->db->NumFields($rsMain);
    while ($oDB->db->FetchRow($rsMain, $row)) {
        $grid->AddDataRow();
        for ($i = 0; $i < $colcnt; $i++) {
            $v = utf8_encode($row[$i]);
            $v = htmlspecialchars($v, ENT_COMPAT, 'UTF-8');
            $grid->AddCell($v);
        }
    }
    $oDB->rsClose($rsMain);
}
$grid->Render("ex3", 1);
// output html
开发者ID:retnan,项目名称:TrunkSMS,代码行数:31,代码来源:ex3simplegrid.php

示例6: getLastStoredDateTime

function getLastStoredDateTime()
{
    OpenDB();
    global $DEBUG;
    $lDate_time = date('i');
    //retrun only minutes
    $dateTimeNow = date('Y-m-d H:i:00');
    if ($DEBUG) {
        echo "\n<p>" . $lDate_time . "</p>\n";
    }
    //fetch minutes and full datetime
    $query = "Select DATE_FORMAT(date_time, '%i') as dt, date_time FROM `avrtemp` ORDER by date_time DESC LIMIT 1;";
    $result = mysql_query($query);
    if ($result) {
        while ($row = mysql_fetch_array($result)) {
            //should only be one row
            $mValDB = $row['dt'];
            if ($DEBUG) {
                echo "\n<p>Minutes stored last: " . $row['dt'] . "</p>\n";
            }
            if (intval($mValDB) - intval($lDate_time) != 0) {
                $diffVal = abs(intval($mValDB) - intval($lDate_time));
                if ($diffVal <= 2) {
                    if ($DEBUG) {
                        echo "\n<p>Data found and Diff <=2: date(now)=" . $dateTimeNow . ", last stored=" . $row['date_time'] . "</p>\n";
                    }
                    return $row['date_time'];
                    //return db last datetime
                } else {
                    if ($DEBUG) {
                        echo "\n<p>Diff > 2: date(now)=" . $dateTimeNow . ", last stored=" . $row['date_time'] . "</p>\n";
                    }
                }
            } else {
                if ($DEBUG) {
                    echo "\n<p>Data found and Diff = 0: date(now)=" . $dateTimeNow . ", last stored=" . $row['date_time'] . "</p>\n";
                }
            }
        }
    } else {
        if ($DEBUG) {
            echo "\n<p>getLastStoredDateTime(): query did not return result</p>\n";
        }
    }
    if ($DEBUG) {
        echo "\n<p>Data not found or Diff to large: " . $dateTimeNow . "</p>\n";
    }
    return $dateTimeNow;
    //return current datetime
}
开发者ID:SuichiesS,项目名称:homewatch,代码行数:50,代码来源:dbhelp.php

示例7: connection_close

function connection_close()
{
    OpenDB();
    global $DBLink;
    mysqli_close($DBLink);
}
开发者ID:MUN06,项目名称:Lok-Sabha-Election-16th,代码行数:6,代码来源:db_trans.inc.php


注:本文中的OpenDB函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。