diff --git a/ChangeLog b/ChangeLog index 3ed5669fb..4b620c6b6 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,12 @@ phpMyAdmin - Changelog $Id$ $Source$ +2004-03-25 Marcel Tschopp + * tbl_change.php, libraries/dbi/mysql.inc.php, libraries/dbi/mysqli.inc.php: + Added wrapping function PMA_DBI_field_len. + * libraries/dbi/mysqli.inc.php: Set default value '' for parameter $link + from function PMA_DBI_insert_id(). + 2004-03-25 Michal Cihar * libraries/bookmark.lib.php: Fix errors when bookmarktable does not exists (bug #922509). diff --git a/libraries/dbi/mysql.dbi.lib.php b/libraries/dbi/mysql.dbi.lib.php index dee41e5f5..3ef54b7ec 100644 --- a/libraries/dbi/mysql.dbi.lib.php +++ b/libraries/dbi/mysql.dbi.lib.php @@ -255,4 +255,8 @@ function PMA_DBI_num_fields($result) { return mysql_num_fields($result); } +function PMA_DBI_field_len($result, $i) { + return mysql_field_len($result, $i); +} + ?> diff --git a/libraries/dbi/mysqli.dbi.lib.php b/libraries/dbi/mysqli.dbi.lib.php index d9122bba4..fee123732 100644 --- a/libraries/dbi/mysqli.dbi.lib.php +++ b/libraries/dbi/mysqli.dbi.lib.php @@ -204,7 +204,7 @@ function PMA_DBI_num_rows($result) { return @mysqli_num_rows($result); } -function PMA_DBI_insert_id($link) { +function PMA_DBI_insert_id($link = '') { if (empty($link)) { if (isset($GLOBALS['userlink'])) { $link = $GLOBALS['userlink']; @@ -344,4 +344,9 @@ function PMA_DBI_num_fields($result) { return mysqli_num_fields($result); } +function PMA_DBI_field_len($result, $i) { + $info = mysqli_fetch_field_direct($result, $i); + return $info->length; +} + ?> diff --git a/tbl_change.php b/tbl_change.php index 129649d2e..f0b32f5d9 100644 --- a/tbl_change.php +++ b/tbl_change.php @@ -297,7 +297,7 @@ foreach($loop_array AS $vrowcount => $vrow) { } $len = (preg_match('@float|double@', $row_table_def['Type'])) ? 100 - : @mysql_field_len($vresult, $i); // !UNWRAPPED FUNCTION! + : PMA_DBI_field_len($vresult, $i); $first_timestamp = 0; $bgcolor = ($i % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo'];