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


PHP PDOStatement::bindColumn方法代码示例

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


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

示例1: bindColumn

 /**
  * Bind a value of the column or field table
  * @access public
  * @param string $column
  * @param mixed $param
  * @param string $type
  * @return void 
  */
 public function bindColumn($column, &$param, $type = null)
 {
     if ($type === null) {
         $this->_statement->bindColumn($column, $param);
     } else {
         $this->_statement->bindColumn($column, $param, $type);
     }
 }
开发者ID:simple-php-mvc,项目名称:simple-php-mvc,代码行数:16,代码来源:PDOStatement.php

示例2: testBindColumn

 /**
  * @covers Fabfuel\Prophiler\Decorator\PDO\PDOStatement::bindColumn
  * @uses Fabfuel\Prophiler\Decorator\PDO\PDOStatement
  */
 public function testBindColumn()
 {
     $column = 'foo';
     $param = 'bar';
     $type = \PDO::PARAM_STR;
     $maxlen = 15;
     $driverdata = 'lorem ipsum';
     $this->pdoStatement->expects($this->once())->method('bindColumn')->with($column, $param, $type, $maxlen, $driverdata)->willReturn(true);
     $this->assertTrue($this->decorator->bindColumn($column, $param, $type, $maxlen, $driverdata));
 }
开发者ID:dez-php,项目名称:prophiler,代码行数:14,代码来源:PDOStatementTest.php

示例3: bindColumn

 /**
  * Bind a column of the statement result set to a PHP variable.
  *
  * @param string $column Name the column in the result set, either by
  *                       position or by name.
  * @param mixed  $param  Reference to the PHP variable containing the value.
  * @param mixed  $type   OPTIONAL
  * @return bool
  * @throws Zend_Db_Statement_Exception
  */
 public function bindColumn($column, &$param, $type = null)
 {
     try {
         if (is_null($type)) {
             return $this->_stmt->bindColumn($column, $param);
         } else {
             return $this->_stmt->bindColumn($column, $param, $type);
         }
     } catch (PDOException $e) {
         require_once 'Zend/Db/Statement/Exception.php';
         throw new Zend_Db_Statement_Exception($e->getMessage());
     }
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:23,代码来源:Pdo.php

示例4: bindColumns

 protected function bindColumns()
 {
     if (!$this->columnsBound) {
         $this->columnsBound = true;
         $this->actRow = array();
         $this->actRowIndex = array();
         $count = $this->pdoStmt->columnCount();
         for ($i = 0; $i < $count; $i++) {
             $meta = $this->pdoStmt->getColumnMeta($i);
             if (array_key_exists('native_type', $meta) && $meta['native_type'] == 'BLOB') {
                 $this->pdoStmt->bindColumn($i + 1, $this->actRow[$meta['name']], \PDO::PARAM_LOB);
             } else {
                 $this->pdoStmt->bindColumn($i + 1, $this->actRow[$meta['name']]);
             }
             $this->actRowIndex[$i] =& $this->actRow[$meta['name']];
         }
     }
 }
开发者ID:robo47,项目名称:BlazeFramework,代码行数:18,代码来源:AbstractResultSet.php

示例5: bindColumn

 /**
  * Bind a column of the statement result set to a PHP variable.
  * Note: This method exists because pass-by-reference won't work with
  * call_user_func_array();
  *
  * @param string $column   Name the column in the result set, either by position
  *                         or by name. Note: if by name must match case.
  * @param mixed  $variable Reference to the PHP variable containing the value.
  * @param mixed  $type     OPTIONAL: PDO::PARAM_* Type hint.
  * @return bool            TRUE on success, FALSE on failure
  */
 public function bindColumn($column, &$variable, $type = null)
 {
     try {
         if (is_null($type)) {
             return $this->_stmt->bindColumn($column, $variable);
         } else {
             return $this->_stmt->bindColumn($column, $variable, $type);
         }
     } catch (PDOException $e) {
         throw new DBALite_Exception("Error binding column '{$column}' to PHP variable", $e);
     }
 }
开发者ID:paulyg,项目名称:dbalite,代码行数:23,代码来源:Statement.php

示例6: bindColumn

 public function bindColumn($column, &$param, $type = null, $maxlen = null, $driverdata = null)
 {
     switch ($type) {
         case PDO::PARAM_JSON:
         case PDO::PARAM_DATETIME:
         case PDO::PARAM_DATE:
         case PDO::PARAM_ARRAY:
             $this->setColumnType($column, $type);
             $this->_columnsVars[$column] =& $param;
             break;
         default:
             return $this->_statement->bindColumn($column, $param, $type, $maxlen, $driverdata);
     }
     return true;
 }
开发者ID:rtshome,项目名称:pgbabylon,代码行数:15,代码来源:PDOStatement.php

示例7: bind

    public function bind(PDOStatement $stmt, YokazeDb_Vo $vo)
    {
        $columnCount = $stmt->columnCount();
        $columnTypes = array();
        $columnNames = array();
        $VoNames     = array();
        for ($i = 0; $i < $columnCount; $i++){
            $meta = $stmt->getColumnMeta($i);
            if (!$meta)
                break;
            //if (isset($meta['pdo_type']))
                $columnTypes[$i] = $meta['pdo_type'];
            $columnNames[$i] = $meta['name'];
            $name = implode('', array_map('ucfirst', explode('_', $meta['name'])));
            $name[0] = strtolower($name[0]);
            $voNames[$i] = $name;
        }


        for($i = 0; $i < $columnCount; $i++){
            $name = $voNames[$i];
            $vo->$name = null;
            $stmt->bindColumn($columnNames[$i], $vo->$name, $columnTypes[$i]);
        }
    }
开发者ID:nishimura,项目名称:YokazeDb,代码行数:25,代码来源:View.php

示例8: bindColumn

 /**
  * {@inheritdoc}
  */
 public function bindColumn($column, &$param, $type = null, $maxlen = null, $driverdata = null)
 {
     return $this->statement->bindColumn($column, $param, $type, $maxlen, $driverdata);
 }
开发者ID:samleybrize,项目名称:bugzorcist,代码行数:7,代码来源:PDOProfilerStatement.php

示例9: bindMenuValues

 /**
  * @param \PDOStatement $stmt
  * @param               $AppID
  * @param               $ComponentID
  * @param               $URL
  * @param               $MenuID
  */
 public function bindMenuValues($stmt, $AppID, $ComponentID, $URL, &$MenuID)
 {
     $stmt->bindValue(':AppID', $AppID, PDO::PARAM_STR);
     $stmt->bindValue(':ComponentID', $ComponentID, PDO::PARAM_STR);
     $stmt->bindValue(':URL', "%{$URL}", PDO::PARAM_STR);
     $stmt->bindColumn('MenuID', $MenuID, PDO::PARAM_INT);
 }
开发者ID:falmar,项目名称:Epsilon,代码行数:14,代码来源:Router.php

示例10: bind

 private function bind(\PDOStatement $statement, $values)
 {
     $count = 1;
     foreach ($values as $value) {
         $statement->bindColumn($count, $value, \PDO::PARAM_STR, strlen($value));
     }
     return $statement;
 }
开发者ID:matheusheiden,项目名称:TinyBoards,代码行数:8,代码来源:DbConn.php

示例11: bindColumn

 /**
  * @param $column
  * @param $param
  * @param null $type
  * @param null $maxlen
  * @param null $driverdata
  * @return bool
  */
 public function bindColumn($column, &$param, $type = null, $maxlen = null, $driverdata = null)
 {
     $archLog = array('method' => 'PDOStatement::bindColumn', 'input' => array('column' => $column, 'param' => $param, 'type' => $type, 'maxlen' => $maxlen, 'driverdata' => $driverdata), 'output' => $this->PDOStatement->bindColumn($column, $param, $type, $maxlen, $driverdata), 'pointer' => $this->assignPointerString());
     return self::setLogReturnOutput($archLog);
 }
开发者ID:AdrianTrainorPHP,项目名称:QueryScanner,代码行数:13,代码来源:ArchPDOStatement.php

示例12: bindColumn

 /**
  * @inheritdoc
  */
 public function bindColumn($column, &$param, $type = null, $maxlen = null, $driverdata = null)
 {
     $this->params[$column] = $param;
     return parent::bindColumn($column, $param, $type, $maxlen, $driverdata);
 }
开发者ID:chrisandchris,项目名称:symfony-rowmapper,代码行数:8,代码来源:PdoStatement.php


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