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


PHP DBConnection::query方法代码示例

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


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

示例1: executeSelect

 /**
  * Executes an SQL SELECT statement
  *
  * @param   rdbms.DBConnection conn
  * @param   rdbms.Peer peer
  * @param   rdbms.join.Joinprocessor jp optional
  * @param   bool buffered default TRUE
  * @return  rdbms.ResultSet
  */
 public function executeSelect(DBConnection $conn, Peer $peer, $jp = null, $buffered = true)
 {
     $statement = preg_replace('/object\\(([^\\)]+)\\)/i', '$1.' . implode(', $1.', array_keys($peer->types)), $this->statement);
     if ($buffered) {
         return $conn->query($statement, ...$this->arguments);
     } else {
         return $conn->open($statement, ...$this->arguments);
     }
 }
开发者ID:xp-framework,项目名称:rdbms,代码行数:18,代码来源:Statement.class.php

示例2: update

 public function update($id)
 {
     $values = [];
     $columns = [];
     foreach (static::$columns as $column) {
         $values[':' . $column] = $this->{$column};
         $columns[] = $column . '=:' . $column;
     }
     $sql = 'UPDATE' . ' ' . static::$table . ' ' . 'SET' . ' ' . implode(',', $columns) . ' ' . 'WHERE id=:id';
     echo $sql;
     $res = new DBConnection();
     $res->query($sql, $id, $values);
 }
开发者ID:spoliv,项目名称:classfin,代码行数:13,代码来源:AbstractModel.php

示例3: array

        $shares = array();
        if (!empty($_POST['1'])) {
            array_push($shares, $_POST['1']);
        }
        if (!empty($_POST['2'])) {
            array_push($shares, $_POST['2']);
        }
        if (!empty($_POST['3'])) {
            array_push($shares, $_POST['3']);
        }
        //var_dump($shares);
        $reconstructed_secret = reconstruct($shares);
        $db = new DBConnection();
        $db->connect();
        $user = get_user_info();
        $secret = $db->query('secret', 'secret', "uid='{$user}'", null, null, null)[0]['secret'];
        $db->delete('secret', "uid='{$user}'");
        $db->disconnect();
        if ($secret == $reconstructed_secret) {
            echo "Secrets matching. Access granted.";
        } else {
            echo "{$secret} != {$reconstructed_secret}. Access denied";
        }
    } else {
        echo "fail";
    }
} else {
    echo "fail";
}
/* [1,8683146895150534502] [2,17361141234745553751] [3,7143385603424603993]
 * Secret 5152555555515253
开发者ID:vishnuvp,项目名称:MultiFactorAuthenticator,代码行数:31,代码来源:reconstruct.php

示例4: DBConnection

<?php

require_once "includes/db.class.inc";
require_once "includes/mailapi.inc";
require_once "includes/session.inc";
if (is_session_active()) {
    $db = new DBConnection();
    $db->connect();
    $user = get_user_info();
    $secretshare = $db->query('shares', 'share', "uid='{$user}' AND share LIKE '[2,%'", null, null, null)[0]['share'];
    //print_r($secretshare);
    $db->delete("shares", "share='{$secretshare}'");
    $db->disconnect();
    //send secretshare in sms
    //sendsms($user, $share)
    echo $secretshare;
    //echo "fail";
    //echo "success";
} else {
    echo "fail";
}
开发者ID:vishnuvp,项目名称:MultiFactorAuthenticator,代码行数:21,代码来源:sendsms.inc.php

示例5: executeSelect

 /**
  * Executes an SQL SELECT statement
  *
  * @param   rdbms.DBConnection conn
  * @param   rdbms.Peer peer
  * @param   rdbms.join.Joinprocessor jp optional
  * @param   bool buffered default TRUE
  * @return  rdbms.ResultSet
  */
 public function executeSelect(DBConnection $conn, Peer $peer, $jp = NULL, $buffered = TRUE)
 {
     return $conn->query('%c', $this->getSelectQueryString($conn, $peer, $jp), $buffered);
 }
开发者ID:melogamepay,项目名称:xp-framework,代码行数:13,代码来源:Criteria.class.php


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