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


PHP DbHandler::clients方法代码示例

本文整理汇总了PHP中DbHandler::clients方法的典型用法代码示例。如果您正苦于以下问题:PHP DbHandler::clients方法的具体用法?PHP DbHandler::clients怎么用?PHP DbHandler::clients使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DbHandler的用法示例。


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

示例1: Utilities

    $utils = new Utilities($utilDb);
    //$assetCnt  = $utils->getCount();
    //$catArray  = $utils->getCategories();  // Get a list of categories
    //$statArray = $utils->getStatus();      // Get a list of status levels
    //$licArray  = $utils->getLicense();     // Get a list of licenses (disabled 2016-07-27/Daniel)
    //$depArray  = $utils->getDepartments(); // Get a list of departments
    //$supArray  = $utils->getSuppliers();   // Get a list of suppliers
}
/**
 * Create an instance of DbHandler and fetch data to be used in the asset form
 */
try {
    $dbh = new DbHandler($DBNAME, $DBUSER, $DBPASSWD, $DBDRIVER, $DBSERVER);
    $assetCnt = $dbh->getCount();
    $catArray = $dbh->categories();
    $arClients = $dbh->clients();
    $depArray = $dbh->departments();
    $manufArray = $dbh->manufacturers();
    $statArray = $dbh->status();
    $supArray = $dbh->suppliers();
} catch (Exception $ex) {
    $template = $twig->loadTemplate('error.tmpl');
    echo $template->render(array('pageTitle' => "OSCAR - ERROR", 'error' => $ex->getMessage()));
    die;
    // Not a very nice solution, but let's run with it for now
}
/**
 * Construct an array with some useful data in it
 */
$cfgData = array('dbServer' => $DBSERVER, 'dbName' => $DBNAME, 'dbType' => $DBTYPE, 'dbUser' => $DBUSER, 'assetCnt' => $assetCnt, 'priv' => $priv, 'userName' => $_SESSION['username']);
try {
开发者ID:druus,项目名称:oscar,代码行数:31,代码来源:index.php

示例2: DbHandler

$asset->setAsset(56);
$asset->setManufacturer("Gnumaker");
$asset->setModel("Supermodel");
echo "Read back the properties\n";
echo "Asset       : " . $asset->getAsset() . "\n";
echo "Manufacturer: " . $asset->getManufacturer() . "\n";
echo "Model       : " . $asset->getModel() . "\n";
echo "\nOK, now let us connect to the database.\n";
$dbname = "asset_v3";
$dbuser = "root";
$dbpasswd = "g4dba103";
$dbhost = "localhost";
$dbtype = "mysql";
echo "dbname={$dbname}\n";
echo "dbuser={$dbuser}\n";
echo "dbhost={$dbhost}\n";
echo "dbtype={$dbtype}\n";
// Create an instance of DbHandler
$dbh = new DbHandler($dbname, $dbuser, $dbpasswd, $dbtype, $dbhost);
echo "Getting the last asset. It seem to be: " . $dbh->getLatestAsset() . "\n";
echo "And list clients...\n";
$clients = $dbh->clients();
echo "\nUsing print_r()\n";
print_r($clients);
echo "\n";
echo "Looping through the array 'manually'\n";
foreach ($clients as $id => $client) {
    echo "ID = " . $clients[$id]['id'] . " - client = " . $client;
}
$dbh = null;
// Close the db handle
开发者ID:druus,项目名称:oscar,代码行数:31,代码来源:t_asset.php


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