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


PHP PMA_getEnumSetAndTimestampColumns函數代碼示例

本文整理匯總了PHP中PMA_getEnumSetAndTimestampColumns函數的典型用法代碼示例。如果您正苦於以下問題:PHP PMA_getEnumSetAndTimestampColumns函數的具體用法?PHP PMA_getEnumSetAndTimestampColumns怎麽用?PHP PMA_getEnumSetAndTimestampColumns使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


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

示例1: PMA_analyzeTableColumnsArray

/**
 * Analyze the table column array
 *
 * @param array   $column         description of column in given table
 * @param array   $comments_map   comments for every column that has a comment
 * @param boolean $timestamp_seen whether a timestamp has been seen
 *
 * @return array                   description of column in given table
 */
function PMA_analyzeTableColumnsArray($column, $comments_map, $timestamp_seen)
{
    $column['Field_html'] = htmlspecialchars($column['Field']);
    $column['Field_md5'] = md5($column['Field']);
    // True_Type contains only the type (stops at first bracket)
    $column['True_Type'] = preg_replace('@\\(.*@s', '', $column['Type']);
    $column['len'] = preg_match('@float|double@', $column['Type']) ? 100 : -1;
    $column['Field_title'] = PMA_getColumnTitle($column, $comments_map);
    $column['is_binary'] = PMA_isColumn($column, array('binary', 'varbinary'));
    $column['is_blob'] = PMA_isColumn($column, array('blob', 'tinyblob', 'mediumblob', 'longblob'));
    $column['is_char'] = PMA_isColumn($column, array('char', 'varchar'));
    list($column['pma_type'], $column['wrap'], $column['first_timestamp']) = PMA_getEnumSetAndTimestampColumns($column, $timestamp_seen);
    return $column;
}
開發者ID:hewenhao2008,項目名稱:phpmyadmin,代碼行數:23,代碼來源:insert_edit.lib.php

示例2: testGetEnumAndTimestampColumns

 /**
  * Test for PMA_getEnumSetAndTimestampColumns
  *
  * @return void
  */
 public function testGetEnumAndTimestampColumns()
 {
     $column = array();
     $column['True_Type'] = 'set';
     $this->assertEquals(array('set', '', false), PMA_getEnumSetAndTimestampColumns($column, false));
     $column['True_Type'] = 'enum';
     $this->assertEquals(array('enum', '', false), PMA_getEnumSetAndTimestampColumns($column, false));
     $column['True_Type'] = 'timestamp';
     $column['Type'] = 'date';
     $this->assertEquals(array('date', ' nowrap', true), PMA_getEnumSetAndTimestampColumns($column, false));
     $column['True_Type'] = 'timestamp';
     $column['Type'] = 'date';
     $this->assertEquals(array('date', ' nowrap', false), PMA_getEnumSetAndTimestampColumns($column, true));
     $column['True_Type'] = 'SET';
     $column['Type'] = 'num';
     $this->assertEquals(array('num', ' nowrap', false), PMA_getEnumSetAndTimestampColumns($column, false));
     $column['True_Type'] = '';
     $column['Type'] = 'num';
     $this->assertEquals(array('num', ' nowrap', false), PMA_getEnumSetAndTimestampColumns($column, false));
 }
開發者ID:kfjihailong,項目名稱:phpMyAdmin,代碼行數:25,代碼來源:PMA_insert_edit_test.php


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