當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Database_Connection::datatype方法代碼示例

本文整理匯總了PHP中Database_Connection::datatype方法的典型用法代碼示例。如果您正苦於以下問題:PHP Database_Connection::datatype方法的具體用法?PHP Database_Connection::datatype怎麽用?PHP Database_Connection::datatype使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Database_Connection的用法示例。


在下文中一共展示了Database_Connection::datatype方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: datatype

 public function datatype($type)
 {
     static $types = array('blob' => array('type' => 'string', 'binary' => true, 'character_maximum_length' => '65535'), 'bool' => array('type' => 'bool'), 'bigint unsigned' => array('type' => 'int', 'min' => '0', 'max' => '18446744073709551615'), 'datetime' => array('type' => 'string'), 'decimal unsigned' => array('type' => 'float', 'exact' => true, 'min' => '0'), 'double' => array('type' => 'float'), 'double precision unsigned' => array('type' => 'float', 'min' => '0'), 'double unsigned' => array('type' => 'float', 'min' => '0'), 'enum' => array('type' => 'string'), 'fixed' => array('type' => 'float', 'exact' => true), 'fixed unsigned' => array('type' => 'float', 'exact' => true, 'min' => '0'), 'float unsigned' => array('type' => 'float', 'min' => '0'), 'int unsigned' => array('type' => 'int', 'min' => '0', 'max' => '4294967295'), 'integer unsigned' => array('type' => 'int', 'min' => '0', 'max' => '4294967295'), 'longblob' => array('type' => 'string', 'binary' => true, 'character_maximum_length' => '4294967295'), 'longtext' => array('type' => 'string', 'character_maximum_length' => '4294967295'), 'mediumblob' => array('type' => 'string', 'binary' => true, 'character_maximum_length' => '16777215'), 'mediumint' => array('type' => 'int', 'min' => '-8388608', 'max' => '8388607'), 'mediumint unsigned' => array('type' => 'int', 'min' => '0', 'max' => '16777215'), 'mediumtext' => array('type' => 'string', 'character_maximum_length' => '16777215'), 'national varchar' => array('type' => 'string'), 'numeric unsigned' => array('type' => 'float', 'exact' => true, 'min' => '0'), 'nvarchar' => array('type' => 'string'), 'point' => array('type' => 'string', 'binary' => true), 'real unsigned' => array('type' => 'float', 'min' => '0'), 'set' => array('type' => 'string'), 'smallint unsigned' => array('type' => 'int', 'min' => '0', 'max' => '65535'), 'text' => array('type' => 'string', 'character_maximum_length' => '65535'), 'tinyblob' => array('type' => 'string', 'binary' => true, 'character_maximum_length' => '255'), 'tinyint' => array('type' => 'int', 'min' => '-128', 'max' => '127'), 'tinyint unsigned' => array('type' => 'int', 'min' => '0', 'max' => '255'), 'tinytext' => array('type' => 'string', 'character_maximum_length' => '255'), 'varchar' => array('type' => 'string', 'exact' => true), 'year' => array('type' => 'string'));
     $type = str_replace(' zerofill', '', $type);
     if (isset($types[$type])) {
         return $types[$type];
     }
     return parent::datatype($type);
 }
開發者ID:SainsburysTests,項目名稱:sainsburys,代碼行數:9,代碼來源:connection.php

示例2: datatype

 public function datatype($type)
 {
     // try to determine the datatype
     $datatype = parent::datatype($type);
     // if not an ANSI database, assume it's string
     return empty($datatype) ? array('type' => 'string') : $datatype;
 }
開發者ID:beingsane,項目名稱:TTII_2012,代碼行數:7,代碼來源:connection.php


注:本文中的Database_Connection::datatype方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。