Translated using Weblate (Estonian)
[phpmyadmin.git] / libraries / dbi / DBIExtension.int.php
blob9cc743300ba456b55073a09e7bcae518124edcc7
1 <?php
2 /**
3 * Contract for every database extension supported by phpMyAdmin
5 * @package PhpMyAdmin-DBI
6 */
7 if (! defined('PHPMYADMIN')) {
8 exit;
11 /**
12 * Contract for every database extension supported by phpMyAdmin
14 * @package PhpMyAdmin-DBI
16 interface PMA_DBI_Extension
18 /**
19 * connects to the database server
21 * @param string $user user name
22 * @param string $password user password
23 * @param bool $is_controluser whether this is a control user connection
24 * @param array $server host/port/socket/persistent
25 * @param bool $auxiliary_connection (when true, don't go back to login if
26 * connection fails)
28 * @return mixed false on error or a connection object on success
30 public function connect(
31 $user, $password, $is_controluser = false, $server = null,
32 $auxiliary_connection = false
35 /**
36 * selects given database
38 * @param string $dbname database name to select
39 * @param object $link connection object
41 * @return boolean
43 public function selectDb($dbname, $link = null);
45 /**
46 * runs a query and returns the result
48 * @param string $query query to execute
49 * @param object $link connection object
50 * @param int $options query options
52 * @return result object|bool
54 public function realQuery($query, $link, $options);
56 /**
57 * Run the multi query and output the results
59 * @param object $link connection object
60 * @param string $query multi query statement to execute
62 * @return result collection | boolean(false)
64 public function realMultiQuery($link, $query);
66 /**
67 * returns array of rows with associative and numeric keys from $result
69 * @param object $result result set identifier
71 * @return array
73 public function fetchArray($result);
75 /**
76 * returns array of rows with associative keys from $result
78 * @param object $result result set identifier
80 * @return array
82 public function fetchAssoc($result);
84 /**
85 * returns array of rows with numeric keys from $result
87 * @param object $result result set identifier
89 * @return array
91 public function fetchRow($result);
93 /**
94 * Adjusts the result pointer to an arbitrary row in the result
96 * @param object $result database result
97 * @param integer $offset offset to seek
99 * @return bool true on success, false on failure
101 public function dataSeek($result, $offset);
104 * Frees memory associated with the result
106 * @param object $result database result
108 * @return void
110 public function freeResult($result);
113 * Check if there are any more query results from a multi query
115 * @param object $link the connection object
117 * @return bool true or false
119 public function moreResults($link = null);
122 * Prepare next result from multi_query
124 * @param objecy $link the connection object
126 * @return bool true or false
128 public function nextResult($link = null);
131 * Store the result returned from multi query
133 * @return mixed false when empty results / result set when not empty
135 public function storeResult();
138 * Returns a string representing the type of connection used
140 * @param object $link mysql link
142 * @return string type of connection used
144 public function getHostInfo($link = null);
147 * Returns the version of the MySQL protocol used
149 * @param object $link mysql link
151 * @return integer version of the MySQL protocol used
153 public function getProtoInfo($link = null);
156 * returns a string that represents the client library version
158 * @return string MySQL client library version
160 public function getClientInfo();
163 * returns last error message or false if no errors occured
165 * @param object $link connection link
167 * @return string|bool $error or false
169 public function getError($link = null);
172 * returns the number of rows returned by last query
174 * @param object $result result set identifier
176 * @return string|int
178 public function numRows($result);
181 * returns last inserted auto_increment id for given $link
182 * or $GLOBALS['userlink']
184 * @param object $link the connection object
186 * @return string|int
188 public function insertId($link = null);
191 * returns the number of rows affected by last query
193 * @param object $link the connection object
194 * @param bool $get_from_cache whether to retrieve from cache
196 * @return string|int
198 public function affectedRows($link = null, $get_from_cache = true);
201 * returns metainfo for fields in $result
203 * @param object $result result set identifier
205 * @return array meta info for fields in $result
207 public function getFieldsMeta($result);
210 * return number of fields in given $result
212 * @param object $result result set identifier
214 * @return int field count
216 public function numFields($result);
219 * returns the length of the given field $i in $result
221 * @param object $result result set identifier
222 * @param int $i field
224 * @return int length of field
226 public function fieldLen($result, $i);
229 * returns name of $i. field in $result
231 * @param object $result result set identifier
232 * @param int $i field
234 * @return string name of $i. field in $result
236 public function fieldName($result, $i);
239 * returns concatenated string of human readable field flags
241 * @param object $result result set identifier
242 * @param int $i field
244 * @return string field flags
246 public function fieldFlags($result, $i);