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


PHP PMA_verifyWhetherValueCanBeTruncatedAndAppendExtraData函数代码示例

本文整理汇总了PHP中PMA_verifyWhetherValueCanBeTruncatedAndAppendExtraData函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_verifyWhetherValueCanBeTruncatedAndAppendExtraData函数的具体用法?PHP PMA_verifyWhetherValueCanBeTruncatedAndAppendExtraData怎么用?PHP PMA_verifyWhetherValueCanBeTruncatedAndAppendExtraData使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: array

            $extra_data = array();
        }
        $transformation_types = array("input_transformation", "transformation");
        foreach ($mime_map as $transformation) {
            $column_name = $transformation['column_name'];
            foreach ($transformation_types as $type) {
                $file = PMA_securePath($transformation[$type]);
                $extra_data = PMA_transformEditedValues($db, $table, $transformation, $edited_values, $file, $column_name, $extra_data, $type);
            }
        }
        // end of loop for each $mime_map
    }
    // Need to check the inline edited value can be truncated by MySQL
    // without informing while saving
    $column_name = $_REQUEST['fields_name']['multi_edit'][0][0];
    PMA_verifyWhetherValueCanBeTruncatedAndAppendExtraData($db, $table, $column_name, $extra_data);
    /**Get the total row count of the table*/
    $_table = new PMA_Table($_REQUEST['table'], $_REQUEST['db']);
    $extra_data['row_count'] = $_table->countRecords();
    $extra_data['sql_query'] = PMA_Util::getMessage($message, $GLOBALS['display_query']);
    $response = PMA_Response::getInstance();
    $response->isSuccess($message->isSuccess());
    $response->addJSON('message', $message);
    $response->addJSON($extra_data);
    exit;
}
if (!empty($return_to_sql_query)) {
    $disp_query = $GLOBALS['sql_query'];
    $disp_message = $message;
    unset($message);
    $GLOBALS['sql_query'] = $return_to_sql_query;
开发者ID:altesien,项目名称:FinalProject,代码行数:31,代码来源:tbl_replace.php

示例2: testVerifyWhetherValueCanBeTruncatedAndAppendExtraData

 /**
  * Test for PMA_verifyWhetherValueCanBeTruncatedAndAppendExtraData
  *
  * @return void
  */
 public function testVerifyWhetherValueCanBeTruncatedAndAppendExtraData()
 {
     $extra_data = array('isNeedToRecheck' => true);
     $meta = new stdClass();
     $_REQUEST['where_clause'][0] = 1;
     $dbi = $this->getMockBuilder('PMA_DatabaseInterface')->disableOriginalConstructor()->getMock();
     $dbi->expects($this->at(0))->method('tryQuery')->with('SELECT `table`.`a` FROM `db`.`table` WHERE 1');
     $meta->type = 'int';
     $dbi->expects($this->at(1))->method('getFieldsMeta')->will($this->returnValue(array($meta)));
     $dbi->expects($this->at(2))->method('fetchValue')->will($this->returnValue(false));
     $dbi->expects($this->at(3))->method('tryQuery')->with('SELECT `table`.`a` FROM `db`.`table` WHERE 1');
     $meta->type = 'int';
     $dbi->expects($this->at(4))->method('getFieldsMeta')->will($this->returnValue(array($meta)));
     $dbi->expects($this->at(5))->method('fetchValue')->will($this->returnValue('123'));
     $dbi->expects($this->at(6))->method('tryQuery')->with('SELECT `table`.`a` FROM `db`.`table` WHERE 1');
     $meta->type = 'timestamp';
     $dbi->expects($this->at(7))->method('getFieldsMeta')->will($this->returnValue(array($meta)));
     $dbi->expects($this->at(8))->method('fetchValue')->will($this->returnValue('2013-08-28 06:34:14'));
     $GLOBALS['dbi'] = $dbi;
     PMA_verifyWhetherValueCanBeTruncatedAndAppendExtraData('db', 'table', 'a', $extra_data);
     $this->assertFalse($extra_data['isNeedToRecheck']);
     PMA_verifyWhetherValueCanBeTruncatedAndAppendExtraData('db', 'table', 'a', $extra_data);
     $this->assertEquals('123', $extra_data['truncatableFieldValue']);
     $this->assertTrue($extra_data['isNeedToRecheck']);
     PMA_verifyWhetherValueCanBeTruncatedAndAppendExtraData('db', 'table', 'a', $extra_data);
     $this->assertEquals('2013-08-28 06:34:14.000000', $extra_data['truncatableFieldValue']);
     $this->assertTrue($extra_data['isNeedToRecheck']);
 }
开发者ID:kfjihailong,项目名称:phpMyAdmin,代码行数:33,代码来源:PMA_insert_edit_test.php


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