Make select(..., , , ) optional

This commit is contained in:
Jakub Vrana 2014-01-15 08:23:26 -08:00
parent e9b5616657
commit 60c8ec61e3
6 changed files with 7 additions and 7 deletions

View file

@ -105,7 +105,7 @@ if (isset($_GET["elastic"])) {
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 file

@ -120,7 +120,7 @@ if (isset($_GET["mongo"])) {
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 file

@ -150,7 +150,7 @@ if (isset($_GET["simpledb"])) {
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 file

@ -89,7 +89,7 @@ if ($_POST["save"]) {
$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 ($_POST["save"]) {
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 file

@ -29,7 +29,7 @@
* @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 file

@ -41,7 +41,7 @@ if ($_GET["val"] && is_ajax()) {
$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());
}