1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-08 15:47:00 +02:00

Avoid fatal errors

This commit is contained in:
Jakub Vrana
2010-10-13 17:53:59 +02:00
parent d2e49b1dc8
commit b0d637b638
20 changed files with 164 additions and 221 deletions

View File

@@ -184,6 +184,25 @@ function get_key_vals($query, $connection2 = null) {
return $return;
}
/** Get all rows of result
* @param string
* @return array associative
*/
function get_rows($query, $connection2 = null) {
global $connection;
if (!is_object($connection2)) {
$connection2 = $connection;
}
$return = array();
$result = $connection2->query($query);
if (is_object($result)) { // can return true
while ($row = $result->fetch_assoc()) {
$return[] = $row;
}
}
return $return;
}
/** Find unique identifier of a row
* @param array
* @param array result of indexes()