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


PHP PMA_getCurrentValueForDifferentTypes函數代碼示例

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


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

示例1: sprintf

             $current_value = $transformation_plugin->applyTransformation($current_value, $transformation_options);
             // check if transformation was successful or not
             // and accordingly set error messages & insert_fail
             if (method_exists($transformation_plugin, 'isSuccess') && !$transformation_plugin->isSuccess()) {
                 $insert_fail = true;
                 $row_skipped = true;
                 $insert_errors[] = sprintf(__('Row: %1$s, Column: %2$s, Error: %3$s'), $rownumber, $column_name, $transformation_plugin->getError());
             }
         }
     }
     if ($file_to_insert->isError()) {
         $message .= $file_to_insert->getError();
     }
     // delete $file_to_insert temporary variable
     $file_to_insert->cleanUp();
     $current_value = PMA_getCurrentValueForDifferentTypes($possibly_uploaded_val, $key, $multi_edit_columns_type, $current_value, $multi_edit_auto_increment, $rownumber, $multi_edit_columns_name, $multi_edit_columns_null, $multi_edit_columns_null_prev, $is_insert, $using_key, $where_clause, $table);
     $current_value_as_an_array = PMA_getCurrentValueAsAnArrayForMultipleEdit($multi_edit_funcs, $multi_edit_salt, $gis_from_text_functions, $current_value, $gis_from_wkb_functions, $func_optional_param, $func_no_param, $key);
     list($query_values, $query_fields) = PMA_getQueryValuesForInsertAndUpdateInMultipleEdit($multi_edit_columns_name, $multi_edit_columns_null, $current_value, $multi_edit_columns_prev, $multi_edit_funcs, $is_insert, $query_values, $query_fields, $current_value_as_an_array, $value_sets, $key, $multi_edit_columns_null_prev);
     if (isset($multi_edit_columns_null[$key])) {
         $multi_edit_columns[$key] = null;
     }
 }
 //end of foreach
 // temporarily store rows not inserted
 // so that they can be populated again.
 if ($insert_fail) {
     $unsaved_values[$rownumber] = $multi_edit_columns;
 }
 if (!$insert_fail && count($query_values) > 0) {
     if ($is_insert) {
         $value_sets[] = implode(', ', $query_values);
開發者ID:altesien,項目名稱:FinalProject,代碼行數:31,代碼來源:tbl_replace.php

示例2: testGetCurrentValueForDifferentTypes

 /**
  * Test for PMA_getCurrentValueForDifferentTypes
  *
  * @return void
  */
 public function testGetCurrentValueForDifferentTypes()
 {
     $prow = array();
     $prow['a'] = '101';
     $dbi = $this->getMockBuilder('PMA_DatabaseInterface')->disableOriginalConstructor()->getMock();
     $dbi->expects($this->at(4))->method('fetchSingleRow')->with('SELECT * FROM `table` WHERE 1;')->will($this->returnValue($prow));
     $GLOBALS['dbi'] = $dbi;
     $result = PMA_getCurrentValueForDifferentTypes('123', 0, array(), null, null, null, null, null, null, true, true, '1', 'table');
     $this->assertEquals('123', $result);
     // case 2
     $result = PMA_getCurrentValueForDifferentTypes(false, 0, array('test'), '', array(1), null, null, null, null, true, true, '1', 'table');
     $this->assertEquals('NULL', $result);
     // case 3
     $result = PMA_getCurrentValueForDifferentTypes(false, 0, array('test'), '', array(), null, null, null, null, true, true, '1', 'table');
     $this->assertEquals("''", $result);
     // case 4
     $_REQUEST['fields']['multi_edit'][0][0] = array();
     $result = PMA_getCurrentValueForDifferentTypes(false, 0, array('set'), '', array(), 0, null, null, null, true, true, '1', 'table');
     $this->assertEquals("''", $result);
     // case 5
     $result = PMA_getCurrentValueForDifferentTypes(false, 0, array('protected'), '', array(), 0, array('a'), null, null, true, true, '1', 'table');
     $this->assertEquals("0x313031", $result);
     // case 6
     $result = PMA_getCurrentValueForDifferentTypes(false, 0, array('protected'), '', array(), 0, array('a'), null, null, true, true, '1', 'table');
     $this->assertEquals("", $result);
     // case 7
     $result = PMA_getCurrentValueForDifferentTypes(false, 0, array('bit'), '20\'12', array(), 0, array('a'), null, null, true, true, '1', 'table');
     $this->assertEquals("b'00010'", $result);
     // case 7
     $result = PMA_getCurrentValueForDifferentTypes(false, 0, array('date'), '20\'12', array(), 0, array('a'), null, null, true, true, '1', 'table');
     $this->assertEquals("'20''12'", $result);
     // case 8
     $_REQUEST['fields']['multi_edit'][0][0] = array();
     $result = PMA_getCurrentValueForDifferentTypes(false, 0, array('set'), '', array(), 0, null, array(1), null, true, true, '1', 'table');
     $this->assertEquals("NULL", $result);
     // case 9
     $result = PMA_getCurrentValueForDifferentTypes(false, 0, array('protected'), '', array(), 0, array('a'), array(null), array(1), true, true, '1', 'table');
     $this->assertEquals("''", $result);
 }
開發者ID:kfjihailong,項目名稱:phpMyAdmin,代碼行數:44,代碼來源:PMA_insert_edit_test.php


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