Skip to content
Browse files

Make select(..., , , ) optional

  • Loading branch information...
1 parent e9b5616 commit 60c8ec61e32c6225a294f2f07ce022dc5290e9f4 @vrana committed Jan 15, 2014
View
2 adminer/drivers/elastic.inc.php
@@ -105,7 +105,7 @@ function fetch_row() {
class Min_Driver extends Min_SQL {
- function select($table, $select, $where, $group, $order, $limit, $page, $print = false) {
+ function select($table, $select, $where, $group, $order = array(), $limit = 1, $page = 0, $print = false) {
global $adminer;
$data = array();
$query = "$table/_search";
View
2 adminer/drivers/mongo.inc.php
@@ -120,7 +120,7 @@ function quote($value) {
return ($value === null ? $value : parent::quote($value));
}
- function select($table, $select, $where, $group, $order, $limit, $page, $print = false) {
+ function select($table, $select, $where, $group, $order = array(), $limit = 1, $page = 0, $print = false) {
$select = ($select == array("*")
? array()
: array_fill_keys($select, true)
View
2 adminer/drivers/simpledb.inc.php
@@ -150,7 +150,7 @@ function _extractIds($table, $queryWhere, $limit) {
return $return;
}
- function select($table, $select, $where, $group, $order, $limit, $page, $print = false) {
+ function select($table, $select, $where, $group, $order = array(), $limit = 1, $page = 0, $print = false) {
global $connection;
$connection->next = $_GET["next"];
$return = parent::select($table, $select, $where, $group, $order, $limit, $page, $print);
View
4 adminer/edit.inc.php
@@ -89,7 +89,7 @@
$select = array("*");
}
if ($select) {
- $result = $driver->select($TABLE, $select, array($where), $select, array(), (isset($_GET["select"]) ? 2 : 1), 0);
+ $result = $driver->select($TABLE, $select, array($where), $select, array(), (isset($_GET["select"]) ? 2 : 1));
$row = $result->fetch_assoc();
if (!$row) { // MySQLi returns null
$row = false;
@@ -102,7 +102,7 @@
if (!support("table") && !$fields) {
if (!$where) { // insert
- $result = $driver->select($TABLE, array("*"), $where, array("*"), array(), 1, 0);
+ $result = $driver->select($TABLE, array("*"), $where, array("*"));
$row = ($result ? $result->fetch_assoc() : false);
if (!$row) {
$row = array($driver->primary => "");
View
2 adminer/include/driver.inc.php
@@ -29,7 +29,7 @@ function quote($value) {
* @param bool whether to print the query
* @return Min_Result
*/
- function select($table, $select, $where, $group, $order, $limit, $page, $print = false) {
+ function select($table, $select, $where, $group, $order = array(), $limit = 1, $page = 0, $print = false) {
global $adminer, $jush;
$is_group = (count($group) < count($select));
$query = $adminer->selectQueryBuild($select, $where, $group, $order, $limit, $page);
View
2 adminer/select.inc.php
@@ -41,7 +41,7 @@
$as = convert_field($fields[key($row)]);
$select = array($as ? $as : idf_escape(key($row)));
$where[] = where_check($unique_idf, $fields);
- $return = $driver->select($TABLE, $select, $where, $select, array(), 1, 0);
+ $return = $driver->select($TABLE, $select, $where, $select);
if ($return) {
echo reset($return->fetch_row());
}

0 comments on commit 60c8ec6

Please sign in to comment.
Something went wrong with that request. Please try again.