17
17
define('PMA_DBI_QUERY_STORE', 1); // Force STORE_RESULT method, ignored by classic MySQL.
18
18
define('PMA_DBI_QUERY_UNBUFFERED', 2); // Do not read whole query
19
19
// PMA_DBI_get_variable()
20
define('PMA_DBI_GETVAR_SESSION', 1);
21
define('PMA_DBI_GETVAR_GLOBAL', 2);
20
define('PMA_DBI_GETVAR_SESSION', 1);
21
define('PMA_DBI_GETVAR_GLOBAL', 2);
24
24
* Checks one of the mysql extensions
828
* array PMA_DBI_get_column_values (string $database, string $table, string $column , mysql db link $link = null)
830
* @param string $database name of database
831
* @param string $table name of table to retrieve columns from
832
* @param string $column name of the column to retrieve data from
833
* @param mixed $link mysql link resource
834
* @return array $field_values
837
function PMA_DBI_get_column_values($database, $table, $column, $link = null)
840
for($i=0; $i< sizeof($column); $i++)
842
$query.= PMA_backquote($column[$i]);
843
if($i < (sizeof($column)-1))
848
$query.= ' FROM ' . PMA_backquote($database) . '.' . PMA_backquote($table);
849
$field_values = PMA_DBI_fetch_result($query, null, null, $link);
851
if (! is_array($field_values) || count($field_values) < 1) {
854
return $field_values;
857
* array PMA_DBI_get_table_data (string $database, string $table, mysql db link $link = null)
859
* @param string $database name of database
860
* @param string $table name of table to retrieve columns from
861
* @param mixed $link mysql link resource
862
* @return array $result
865
function PMA_DBI_get_table_data($database, $table, $link = null)
868
$result = PMA_DBI_fetch_result(
869
'SELECT * FROM ' . PMA_backquote($database) . '.' . PMA_backquote($table),
872
if (! is_array($result) || count($result) < 1) {
879
* array PMA_DBI_get_table_indexes($database, $table, $link = null)
881
* @param string $database name of database
882
* @param string $table name of the table whose indexes are to be retreived
883
* @param mixed $link mysql link resource
884
* @return array $indexes
887
function PMA_DBI_get_table_indexes($database, $table, $link = null)
890
$indexes = PMA_DBI_fetch_result(
891
'SHOW INDEXES FROM ' .PMA_backquote($database) . '.' . PMA_backquote($table),
894
if (! is_array($indexes) || count($indexes) < 1) {
829
901
* returns value of given mysql server variable
831
903
* @param string $var mysql server variable name
935
* Function called just after a connection to the MySQL database server has been established
936
* It sets the connection collation, and determins the version of MySQL which is running.
861
938
* @uses ./libraries/charset_conversion.lib.php
862
939
* @uses PMA_DBI_QUERY_STORE
863
940
* @uses PMA_MYSQL_INT_VERSION to set it
1315
1392
* @uses PMA_DBI_fetch_result()
1316
1393
* @param string $db db name
1317
1394
* @param string $table table name
1318
* @param string $delimiter the delimiter to use (may be empty)
1395
* @param string $delimiter the delimiter to use (may be empty)
1320
1397
* @return array information about triggers (may be empty)
1358
1435
return($result);
1439
* Returns TRUE if $db.$view_name is a view, FALSE if not
1441
* @uses PMA_DBI_fetch_result()
1442
* @param string $db database name
1443
* @param string $view_name view/table name
1445
* @return bool TRUE if $db.$view_name is a view, FALSE if not
1447
function PMA_isView($db, $view_name)
1449
$result = PMA_DBI_fetch_result("SELECT TABLE_NAME FROM information_schema.VIEWS WHERE TABLE_SCHEMA = '".$db."' and TABLE_NAME = '".$view_name."';");