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


PHP DataManager::retrieveNumberOfResults方法代码示例

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


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

示例1: getControlMessage

function getControlMessage($sid)
{
    $dbM = new DataManager(SXN_USER, SXN_PASSWORD, "localhost", SXN_DATABASE_CONTROL);
    $dbM->selectAllFromTable(SXN_CONTROL_TABLE_COMMANDS, SXN_CONTROL_COMMANDS_COLUMN_SID . "=" . "{$sid} AND " . SXN_CONTROL_COMMANDS_COLUMN_STATUS . "=" . "'new'");
    //TODO add enum table for new, etc..
    $numRes = $dbM->retrieveNumberOfResults();
    if ($numRes > 0) {
        while ($data = $dbM->retrieveResult()) {
            echo " :" . $data[SXN_CONTROL_COMMANDS_COLUMN_COMMAND] . "\n";
        }
        //Update status to "executed"
        $columns = array(SXN_CONTROL_COMMANDS_COLUMN_STATUS);
        $values = array("executed");
        $dbM->updateRow(SXN_CONTROL_TABLE_COMMANDS, $columns, $values, SXN_CONTROL_COMMANDS_COLUMN_SID . "=" . "{$sid} AND " . SXN_CONTROL_COMMANDS_COLUMN_STATUS . "=" . "'new'");
    }
}
开发者ID:bsaxen,项目名称:sxndata,代码行数:16,代码来源:index.php

示例2: fopen

 if ($importFile != "error" || $sid == 999) {
     echo "<br>Importing {$importFile} to database<br>";
     $in = fopen($importFile, "r") or die("can't open file r: {$importFile}");
     while (!feof($in)) {
         $row = fgets($in);
         //echo("$row<br/>");
         sscanf($row, "%d:%d:%d %f %f", $hour, $min, $sec, $data, $delay);
         //echo("$sid $yy-$mm-$dd $hour:$min:$sec,$data,$delay<br>");
         $timestamp = date('Y-m-d G:i:s', mktime($hour, $min, $sec, $mm, $dd, $yy));
         //echo("$sid $data $timestamp<br>");
         if ($g_dbM2) {
             $tableName = SXN_COLLECTOR_TABLE_DATA_PREFIX . $sid;
             //$doesTableExist = $this->mysqli_->query("SELECT 1 FROM $tableName");
             //$doesTableExist = $g_dbM2->selectAllFromTable($tableName, $conditions);
             $g_dbM1->selectAllFromTable(SXN_ADMIN_TABLE_STREAMS, SXN_ADMIN_STREAMS_COLUMN_SID . " = {$sid}");
             $doesSidExist = $g_dbM1->retrieveNumberOfResults();
             //$g_dbM2->checkIfValueExists(SXN_ADMIN_TABLE_USERS,SXN_ADMIN_USERS_COLUMN_NAME,$name) == false
             if ($doesSidExist) {
                 //echo "Sid is ok! data=$data time=$timestamp \n";
                 $valueArray = array($data, $timestamp);
                 $columnArray = array(SXN_COLLECTOR_DATA_COLUMN_VALUE, SXN_GENERAL_COLUMN_TIMESTAMP);
                 $g_dbM2->insertRow($tableName, $columnArray, $valueArray);
                 //return true;
             } else {
                 echo "Sid does not exists! ({$doesSidExist})\n";
             }
         } else {
             echo "-Database is not open. Data not added!\n";
         }
     }
     fclose($in);
开发者ID:bsaxen,项目名称:sxndata,代码行数:31,代码来源:sxn_config.php


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