[ Index ] |
|
Code source de phpMyAdmin 2.10.3 |
[Code source] [Imprimer] [Statistiques]
Common Option Constants For DBI Functions
Poids: | 1245 lignes (48 kb) |
Inclus ou requis: | 1 fois |
Référencé: | 0 fois |
Nécessite: | 3 fichiers libraries/iconv_wrapper.lib.php libraries/charset_conversion.lib.php libraries/mysql_charsets.lib.php |
PMA_DBI_checkAndLoadMysqlExtension( $extension = 'mysql' ) X-Ref |
Loads the mysql extensions if it is not loaded yet param: string $extension mysql extension to load |
PMA_DBI_query($query, $link = null, $options = 0) X-Ref |
Common Functions |
PMA_DBI_convert_message( $message ) X-Ref |
converts charset of a mysql message, usally coming from mysql_error(), into PMA charset, usally UTF-8 uses language to charset mapping from mysql/share/errmsg.txt and charset names to ISO charset from information_schema.CHARACTER_SETS param: string $message return: string $message |
PMA_DBI_get_tables($database, $link = null) X-Ref |
returns array with table names for given db param: string $database name of database param: mixed $link mysql link resource|object return: array tables names |
PMA_DBI_get_tables_full($database, $table = false,$tbl_is_group = false, $link = null) X-Ref |
returns array of all tables in given db or dbs this function expects unqoted names: RIGHT: my_database WRONG: `my_database` WRONG: my\_database if $tbl_is_group is true, $table is used as filter for table names if $tbl_is_group is 'comment, $table is used as filter for table comments <code> PMA_DBI_get_tables_full( 'my_database' ); PMA_DBI_get_tables_full( 'my_database', 'my_table' ) ); PMA_DBI_get_tables_full( 'my_database', 'my_tables_', true ) ); PMA_DBI_get_tables_full( 'my_database', 'my_tables_', 'comment' ) ); </code> param: string $databases database param: string $table table param: boolean|string $tbl_is_group $table is a table group param: resource $link mysql link return: array list of tables in given db(s) |
PMA_DBI_get_databases_full($database = null, $force_stats = false,$link = null, $sort_by = 'SCHEMA_NAME', $sort_order = 'ASC',$limit_offset = 0, $limit_count = false) X-Ref |
returns array with databases containing extended infos about them param: string $databases database param: boolean $force_stats retrieve stats also for MySQL < 5 param: resource $link mysql link param: string $sort_by collumn to order by param: string $sort_order ASC or DESC param: integer $limit_offset starting offset for LIMIT param: bool|int $limit_count row count for LIMIT or true for $GLOBALS['cfg']['MaxDbList'] return: array $databases |
PMA_DBI_get_columns_full($database = null, $table = null,$column = null, $link = null) X-Ref |
returns detailed array with all columns for given table in database, or all tables/databases param: string $database name of database param: string $table name of table to retrieve columns from param: string $column name of specific column param: mixed $link mysql link resource |
PMA_DBI_get_fields($database, $table, $link = null) X-Ref |
param: string $database name of database param: string $table name of table to retrieve columns from param: mixed $link mysql link resource return: array column info |
PMA_DBI_get_columns($database, $table, $full = false, $link = null) X-Ref |
array PMA_DBI_get_columns(string $database, string $table, bool $full = false, mysql db link $link = null) param: string $database name of database param: string $table name of table to retrieve columns from param: boolean $full wether to return full info or only column names param: mixed $link mysql link resource return: array column names |
PMA_DBI_get_variable($var, $type = PMA_DBI_GETVAR_SESSION, $link = null) X-Ref |
returns value of given mysql server variable param: string $var mysql server variable name param: int $type PMA_DBI_GETVAR_SESSION|PMA_DBI_GETVAR_GLOBAL param: mixed $link mysql link resource|object return: mixed value for mysql server variable |
PMA_DBI_postConnect($link, $is_controluser = false) X-Ref |
param: mixed $link mysql link resource|object param: boolean $is_controluser |
PMA_DBI_fetch_value( $result, $row_number = 0, $field = 0, $link = null, $options = 0 ) X-Ref |
returns a single value from the given result or query, if the query or the result has more than one row or field the first field of the first row is returned <code> $sql = 'SELECT `name` FROM `user` WHERE `id` = 123'; $user_name = PMA_DBI_fetch_value( $sql ); // produces // $user_name = 'John Doe' </code> param: string|mysql_result $result query or mysql result param: integer $row_number row to fetch the value from, param: integer|string $field field to fetch the value from, param: resource $link mysql link param: mixed $options return: mixed value of first field in first row from result |
PMA_DBI_fetch_single_row( $result, $type = 'ASSOC', $link = null, $options = 0 ) X-Ref |
returns only the first row from the result <code> $sql = 'SELECT * FROM `user` WHERE `id` = 123'; $user = PMA_DBI_fetch_single_row( $sql ); // produces // $user = array( 'id' => 123, 'name' => 'John Doe' ) </code> param: string|mysql_result $result query or mysql result param: string $type NUM|ASSOC|BOTH param: resource $link mysql link param: mixed $options return: array|boolean first row from result |
PMA_DBI_fetch_result( $result, $key = null, $value = null,$link = null, $options = 0 ) X-Ref |
returns all rows in the resultset in one array <code> $sql = 'SELECT * FROM `user`'; $users = PMA_DBI_fetch_result( $sql ); // produces // $users[] = array( 'id' => 123, 'name' => 'John Doe' ) $sql = 'SELECT `id`, `name` FROM `user`'; $users = PMA_DBI_fetch_result( $sql, 'id' ); // produces // $users['123'] = array( 'id' => 123, 'name' => 'John Doe' ) $sql = 'SELECT `id`, `name` FROM `user`'; $users = PMA_DBI_fetch_result( $sql, 0 ); // produces // $users['123'] = array( 0 => 123, 1 => 'John Doe' ) $sql = 'SELECT `id`, `name` FROM `user`'; $users = PMA_DBI_fetch_result( $sql, 'id', 'name' ); // or $users = PMA_DBI_fetch_result( $sql, 0, 1 ); // produces // $users['123'] = 'John Doe' $sql = 'SELECT `name` FROM `user`'; $users = PMA_DBI_fetch_result( $sql ); // produces // $users[] = 'John Doe' </code> param: string|mysql_result $result query or mysql result param: string|integer $key field-name or offset param: string|integer $value value-name or offset param: resource $link mysql link param: mixed $options return: array resultrows or values indexed by $key |
PMA_DBI_get_default_engine() X-Ref |
return default table engine for given database return: string default table engine |
PMA_DBI_getCompatibilities() X-Ref |
Get supported SQL compatibility modes return: array supported SQL compatibility modes |
PMA_DBI_get_warnings($link = null) X-Ref |
returns warnings for last query param: resource mysql link $link mysql link resource return: array warnings |
PMA_isSuperuser() X-Ref |
returns true (int > 0) if current user is superuser otherwise 0 return: integer $is_superuser |
PMA_DBI_get_procedures_or_functions($db, $which, $link = null) X-Ref |
returns an array of PROCEDURE or FUNCTION names for a db param: string $db db name param: string $which PROCEDURE | FUNCTION param: resource $link mysql link return: array the procedure names or function names |
PMA_DBI_get_procedure_or_function_def($db, $which, $proc_or_function_name, $link = null) X-Ref |
returns the definition of a specific PROCEDURE or FUNCTION param: string $db db name param: string $which PROCEDURE | FUNCTION param: string $proc_or_function_name the procedure name or function name param: resource $link mysql link return: string the procedure's or function's definition |
Généré le : Mon Nov 26 15:18:20 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |