bye bye, mysql_wrappers...
This commit is contained in:
@@ -12,6 +12,8 @@ $Source$
|
|||||||
tbl_properties_table_info.php, libraries/mysql_charsets.lib.php:
|
tbl_properties_table_info.php, libraries/mysql_charsets.lib.php:
|
||||||
Added ability to set / alter collations for databases, tables and fields.
|
Added ability to set / alter collations for databases, tables and fields.
|
||||||
* tbl_alter.php: Charset information got lost when changing fields.
|
* tbl_alter.php: Charset information got lost when changing fields.
|
||||||
|
* libraries/common.lib.php, libraries/mysql_wrappers.lib.php:
|
||||||
|
Removed mysql_wrappers library.
|
||||||
|
|
||||||
2004-04-16 Marc Delisle <lem9@users.sourceforge.net>
|
2004-04-16 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* lang/french update
|
* lang/french update
|
||||||
|
@@ -145,13 +145,6 @@ if ($cfg['FileRevision'][0] < 2 || ($cfg['FileRevision'][0] == 2 && $cfg['FileRe
|
|||||||
*/
|
*/
|
||||||
require_once('./libraries/select_lang.lib.php');
|
require_once('./libraries/select_lang.lib.php');
|
||||||
|
|
||||||
if ($is_minimum_common == FALSE) {
|
|
||||||
/**
|
|
||||||
* Include MySQL wrappers (discounted).
|
|
||||||
*/
|
|
||||||
require_once('./libraries/mysql_wrappers.lib.php');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets constants that defines the PHP version number.
|
* Gets constants that defines the PHP version number.
|
||||||
* This include must be located physically before any code that needs to
|
* This include must be located physically before any code that needs to
|
||||||
|
@@ -1,136 +0,0 @@
|
|||||||
<?php
|
|
||||||
/* $Id$ */
|
|
||||||
// vim: expandtab sw=4 ts=4 sts=4:
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Functions to wrap around MySQL database functions. This is basically made
|
|
||||||
* to allow charset conversion, but later may be useful for other stuff.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
// this one is no longer used:
|
|
||||||
function PMA_mysql_dbname($result, $row, $field = FALSE) {
|
|
||||||
if ($field != FALSE) {
|
|
||||||
return PMA_convert_display_charset(mysql_dbname($result, $row, $field));
|
|
||||||
} else {
|
|
||||||
return PMA_convert_display_charset(mysql_dbname($result, $row));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function PMA_mysql_error($id = FALSE) {
|
|
||||||
if ($id != FALSE) {
|
|
||||||
if (mysql_errno($id) != 0) {
|
|
||||||
return PMA_convert_display_charset('#' . mysql_errno($id) . ' - ' . mysql_error($id));
|
|
||||||
}
|
|
||||||
} elseif (mysql_errno() != 0) {
|
|
||||||
return PMA_convert_display_charset('#' . mysql_errno() . ' - ' . mysql_error());
|
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
function PMA_mysql_fetch_field($result , $field_offset = FALSE) {
|
|
||||||
if ($field_offset != FALSE) {
|
|
||||||
return PMA_convert_display_charset(mysql_fetch_field($result, $field_offset));
|
|
||||||
} else {
|
|
||||||
return PMA_convert_display_charset(mysql_fetch_field($result));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function PMA_mysql_fetch_row($result) {
|
|
||||||
/* nijel: This is not optimal, but keeps us from duplicating code, if
|
|
||||||
* speed really matters, duplicate here code from PMA_mysql_fetch_array
|
|
||||||
* with removing rows working with associative array. */
|
|
||||||
return PMA_mysql_fetch_array($result, MYSQL_NUM);
|
|
||||||
}
|
|
||||||
|
|
||||||
function PMA_mysql_field_flags($result, $field_offset) {
|
|
||||||
return PMA_convert_display_charset(mysql_field_flags($result, $field_offset));
|
|
||||||
}
|
|
||||||
|
|
||||||
function PMA_mysql_field_name($result, $field_index) {
|
|
||||||
return PMA_convert_display_charset(mysql_field_name($result, $field_index));
|
|
||||||
}
|
|
||||||
|
|
||||||
function PMA_mysql_field_type($result, $field_index) {
|
|
||||||
return PMA_convert_display_charset(mysql_field_type($result, $field_index));
|
|
||||||
}
|
|
||||||
|
|
||||||
function PMA_mysql_query($query, $link_identifier = FALSE, $result_mode = FALSE) {
|
|
||||||
if ($link_identifier != FALSE) {
|
|
||||||
if ($result_mode != FALSE) {
|
|
||||||
return mysql_query(PMA_convert_charset($query), $link_identifier, $result_mode);
|
|
||||||
} else {
|
|
||||||
return mysql_query(PMA_convert_charset($query), $link_identifier);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return mysql_query(PMA_convert_charset($query));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// mysql_list_tables() is deprecated, also we got report about weird results
|
|
||||||
// under some circumstances
|
|
||||||
|
|
||||||
function PMA_mysql_list_tables($database_name, $link_identifier = FALSE) {
|
|
||||||
if ($link_identifier != FALSE) {
|
|
||||||
return PMA_mysql_query('SHOW TABLES FROM ' . PMA_backquote(PMA_convert_charset($database_name)), $link_identifier);
|
|
||||||
} else {
|
|
||||||
return PMA_mysql_query('SHOW TABLES FROM ' . PMA_backquote(PMA_convert_charset($database_name)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// mysql_list_fields() is deprecated, also we got report about weird results
|
|
||||||
// under some circumstances
|
|
||||||
//
|
|
||||||
// using SELECT * FROM db.table
|
|
||||||
// lets us use functions like mysql_field_name() on the result set
|
|
||||||
|
|
||||||
function PMA_mysql_list_fields_alternate($database_name, $table_name, $link_identifier = FALSE) {
|
|
||||||
if ($link_identifier != FALSE) {
|
|
||||||
$result = PMA_mysql_query('SHOW FIELDS FROM '
|
|
||||||
. PMA_backquote(PMA_convert_charset($database_name)) . '.'
|
|
||||||
. PMA_backquote(PMA_convert_charset($table_name)), $link_identifier);
|
|
||||||
} else {
|
|
||||||
$result = PMA_mysql_query('SHOW FIELDS FROM '
|
|
||||||
. PMA_backquote(PMA_convert_charset($database_name)) . '.'
|
|
||||||
. PMA_backquote(PMA_convert_charset($table_name)));
|
|
||||||
}
|
|
||||||
|
|
||||||
$fields = array();
|
|
||||||
while ($row = PMA_mysql_fetch_array($result)) {
|
|
||||||
$fields[] = $row;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $fields;
|
|
||||||
}
|
|
||||||
|
|
||||||
function PMA_mysql_list_fields($database_name, $table_name, $link_identifier = FALSE) {
|
|
||||||
if ($link_identifier != FALSE) {
|
|
||||||
return mysql_list_fields(PMA_convert_charset($database_name), PMA_convert_charset($table_name), $link_identifier);
|
|
||||||
} else {
|
|
||||||
return mysql_list_fields(PMA_convert_charset($database_name), PMA_convert_charset($table_name));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function PMA_mysql_result($result, $row, $field = FALSE) {
|
|
||||||
if ($field != FALSE) {
|
|
||||||
return PMA_convert_display_charset(mysql_result($result, $row, PMA_convert_charset($field)));
|
|
||||||
} else {
|
|
||||||
return PMA_convert_display_charset(mysql_result($result, $row));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function PMA_mysql_select_db($database_name, $link_identifier = FALSE) {
|
|
||||||
if ($link_identifier != FALSE) {
|
|
||||||
return mysql_select_db(PMA_convert_charset($database_name), $link_identifier);
|
|
||||||
} else {
|
|
||||||
return mysql_select_db(PMA_convert_charset($database_name));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function PMA_mysql_tablename($result, $i) {
|
|
||||||
return PMA_convert_display_charset(mysql_tablename($result, $i));
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
Reference in New Issue
Block a user