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


PHP Zend_Db_Adapter_Pdo_Mysql::describeTable方法代码示例

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


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

示例1: indexAction

 public function indexAction()
 {
     $db = new Zend_Db_Adapter_Pdo_Mysql(array('host' => 'localhost', 'username' => 'root', 'password' => '', 'dbname' => 'alphahyd'));
     $aTables = $db->listTables();
     $this->view->tables = $aTables;
     $sql = 'SHOW COLUMNS FROM alphahyd.tmp';
     $aRowTables = $db->describeTable('categories');
     $this->view->rowTable = $aRowTables;
     //var_dump($aRowTables);
 }
开发者ID:Alpha-Hydro,项目名称:alpha-hydro-antares,代码行数:10,代码来源:ModelsGeneratorController.php

示例2: describeTable

 /**
  * Returns the column descriptions for a table.
  *
  * The return value is an associative array keyed by the column name,
  * as returned by the RDBMS.
  *
  * The value of each array element is an associative array
  * with the following keys:
  *
  * SCHEMA_NAME      => string; name of database or schema
  * TABLE_NAME       => string;
  * COLUMN_NAME      => string; column name
  * COLUMN_POSITION  => number; ordinal position of column in table
  * DATA_TYPE        => string; SQL datatype name of column
  * DEFAULT          => string; default expression of column, null if none
  * NULLABLE         => boolean; true if column can have nulls
  * LENGTH           => number; length of CHAR/VARCHAR
  * SCALE            => number; scale of NUMERIC/DECIMAL
  * PRECISION        => number; precision of NUMERIC/DECIMAL
  * UNSIGNED         => boolean; unsigned property of an integer type
  * PRIMARY          => boolean; true if column is part of the primary key
  * PRIMARY_POSITION => integer; position of column in primary key
  * IDENTITY         => integer; true if column is auto-generated with unique values
  *
  * @param string $tableName
  * @param string $schemaName OPTIONAL
  * @return array
  */
 public function describeTable($tableName, $schemaName = null)
 {
     $cacheKey = $this->_getTableName($tableName, $schemaName);
     $ddl = $this->loadDdlCache($cacheKey, self::DDL_DESCRIBE);
     if ($ddl === false) {
         $ddl = parent::describeTable($tableName, $schemaName);
         /**
          * Remove bug in some MySQL versions, when int-column without default value is described as:
          * having default empty string value
          */
         $affected = array('tinyint', 'smallint', 'mediumint', 'int', 'bigint');
         foreach ($ddl as $key => $columnData) {
             if ($columnData['DEFAULT'] === '' && array_search($columnData['DATA_TYPE'], $affected) !== FALSE) {
                 $ddl[$key]['DEFAULT'] = null;
             }
         }
         $this->saveDdlCache($cacheKey, self::DDL_DESCRIBE, $ddl);
     }
     return $ddl;
 }
开发者ID:z4kko,项目名称:smartdevs-indexer,代码行数:48,代码来源:Mysql.php

示例3: describeTable

 /**
  * Returns the column descriptions for a table.
  *
  * The return value is an associative array keyed by the column name,
  * as returned by the RDBMS.
  *
  * The value of each array element is an associative array
  * with the following keys:
  *
  * SCHEMA_NAME      => string; name of database or schema
  * TABLE_NAME       => string;
  * COLUMN_NAME      => string; column name
  * COLUMN_POSITION  => number; ordinal position of column in table
  * DATA_TYPE        => string; SQL datatype name of column
  * DEFAULT          => string; default expression of column, null if none
  * NULLABLE         => boolean; true if column can have nulls
  * LENGTH           => number; length of CHAR/VARCHAR
  * SCALE            => number; scale of NUMERIC/DECIMAL
  * PRECISION        => number; precision of NUMERIC/DECIMAL
  * UNSIGNED         => boolean; unsigned property of an integer type
  * PRIMARY          => boolean; true if column is part of the primary key
  * PRIMARY_POSITION => integer; position of column in primary key
  * IDENTITY         => integer; true if column is auto-generated with unique values
  *
  * @param string $tableName
  * @param string $schemaName OPTIONAL
  * @return array
  */
 public function describeTable($tableName, $schemaName = null)
 {
     $cacheKey = $this->_getTableName($tableName, $schemaName);
     $ddl = $this->loadDdlCache($cacheKey, self::DDL_DESCRIBE);
     if ($ddl === false) {
         $ddl = parent::describeTable($tableName, $schemaName);
         $this->saveDdlCache($cacheKey, self::DDL_DESCRIBE, $ddl);
     }
     return $ddl;
 }
开发者ID:votanlean,项目名称:Magento-Pruebas,代码行数:38,代码来源:Mysql.php

示例4: describeTable

 /**
  * Returns the column descriptions for a table.
  *
  * The return value is an associative array keyed by the column name,
  * as returned by the RDBMS.
  *
  * The value of each array element is an associative array
  * with the following keys:
  *
  * SCHEMA_NAME      => string; name of database or schema
  * TABLE_NAME       => string;
  * COLUMN_NAME      => string; column name
  * COLUMN_POSITION  => number; ordinal position of column in table
  * DATA_TYPE        => string; SQL datatype name of column
  * DEFAULT          => string; default expression of column, null if none
  * NULLABLE         => boolean; true if column can have nulls
  * LENGTH           => number; length of CHAR/VARCHAR
  * SCALE            => number; scale of NUMERIC/DECIMAL
  * PRECISION        => number; precision of NUMERIC/DECIMAL
  * UNSIGNED         => boolean; unsigned property of an integer type
  * PRIMARY          => boolean; true if column is part of the primary key
  * PRIMARY_POSITION => integer; position of column in primary key
  * IDENTITY         => integer; true if column is auto-generated with unique values
  *
  * @param string $tableName
  * @param string $schemaName OPTIONAL
  * @return array
  */
 public function describeTable($tableName, $schemaName = null)
 {
     $cacheKey = $this->_getTableName($tableName, $schemaName);
     if (!isset($this->_ddlCache[self::DDL_DESCRIBE][$cacheKey])) {
         $this->_ddlCache[self::DDL_DESCRIBE][$cacheKey] = parent::describeTable($tableName, $schemaName);
     }
     return $this->_ddlCache[self::DDL_DESCRIBE][$cacheKey];
 }
开发者ID:jauderho,项目名称:magento-mirror,代码行数:36,代码来源:Mysql.php

示例5: describeTable

 /**
  * Returns the column descriptions for a table.
  *
  * The return value is an associative array keyed by the column name,
  * as returned by the RDBMS.
  *
  * The value of each array element is an associative array
  * with the following keys:
  *
  * SCHEMA_NAME      => string; name of database or schema
  * TABLE_NAME       => string;
  * COLUMN_NAME      => string; column name
  * COLUMN_POSITION  => number; ordinal position of column in table
  * DATA_TYPE        => string; SQL datatype name of column
  * DEFAULT          => string; default expression of column, null if none
  * NULLABLE         => boolean; true if column can have nulls
  * LENGTH           => number; length of CHAR/VARCHAR
  * SCALE            => number; scale of NUMERIC/DECIMAL
  * PRECISION        => number; precision of NUMERIC/DECIMAL
  * UNSIGNED         => boolean; unsigned property of an integer type
  * PRIMARY          => boolean; true if column is part of the primary key
  * PRIMARY_POSITION => integer; position of column in primary key
  * IDENTITY         => integer; true if column is auto-generated with unique values
  *
  * @param string $tableName
  * @param string $schemaName OPTIONAL
  * @return array
  */
 public function describeTable($tableName, $schemaName = null)
 {
     $key = $tableName;
     if ($schemaName) {
         $key = $schemaName . '.' . $key;
     }
     if (!isset($this->_describesCache[$key])) {
         $this->_describesCache[$key] = parent::describeTable($tableName, $schemaName);
     }
     return $this->_describesCache[$key];
 }
开发者ID:ronseigel,项目名称:agent-ohm,代码行数:39,代码来源:Mysql.php


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