Added history database support to the function '*_get_value_filter'

This commit is contained in:
Alejandro Gallardo Escobar 2015-05-18 18:05:09 +02:00
parent 95428eea4d
commit c5d80cd104
4 changed files with 10 additions and 10 deletions

View File

@ -395,7 +395,7 @@ function mysql_encapsule_fields_with_same_name_to_instructions($field) {
* *
* @return mixed Value of first column of the first row. False if there were no row. * @return mixed Value of first column of the first row. False if there were no row.
*/ */
function mysql_db_get_value_filter ($field, $table, $filter, $where_join = 'AND') { function mysql_db_get_value_filter ($field, $table, $filter, $where_join = 'AND', $search_history_db = false) {
if (! is_array ($filter) || empty ($filter)) if (! is_array ($filter) || empty ($filter))
return false; return false;
@ -407,7 +407,7 @@ function mysql_db_get_value_filter ($field, $table, $filter, $where_join = 'AND'
$field, $table, $field, $table,
db_format_array_where_clause_sql ($filter, $where_join)); db_format_array_where_clause_sql ($filter, $where_join));
$result = db_get_all_rows_sql ($sql); $result = db_get_all_rows_sql ($sql, $search_history_db);
if ($result === false) if ($result === false)
return false; return false;

View File

@ -483,7 +483,7 @@ function oracle_encapsule_fields_with_same_name_to_instructions($field) {
* *
* @return mixed Value of first column of the first row. False if there were no row. * @return mixed Value of first column of the first row. False if there were no row.
*/ */
function oracle_db_get_value_filter ($field, $table, $filter, $where_join = 'AND') { function oracle_db_get_value_filter ($field, $table, $filter, $where_join = 'AND', $search_history_db = false) {
if (! is_array ($filter) || empty ($filter)) if (! is_array ($filter) || empty ($filter))
return false; return false;
@ -494,7 +494,7 @@ function oracle_db_get_value_filter ($field, $table, $filter, $where_join = 'AND
$sql = sprintf ("SELECT * FROM (SELECT %s FROM %s WHERE %s) WHERE rownum < 2", $sql = sprintf ("SELECT * FROM (SELECT %s FROM %s WHERE %s) WHERE rownum < 2",
$field, $table, $field, $table,
db_format_array_where_clause_sql ($filter, $where_join)); db_format_array_where_clause_sql ($filter, $where_join));
$result = db_get_all_rows_sql ($sql); $result = db_get_all_rows_sql ($sql, $search_history_db);
if ($result === false) if ($result === false)
return false; return false;

View File

@ -404,7 +404,7 @@ function postgresql_encapsule_fields_with_same_name_to_instructions($field) {
* *
* @return mixed Value of first column of the first row. False if there were no row. * @return mixed Value of first column of the first row. False if there were no row.
*/ */
function postgresql_db_get_value_filter ($field, $table, $filter, $where_join = 'AND') { function postgresql_db_get_value_filter ($field, $table, $filter, $where_join = 'AND', $search_history_db = false) {
if (! is_array ($filter) || empty ($filter)) if (! is_array ($filter) || empty ($filter))
return false; return false;
@ -427,7 +427,7 @@ function postgresql_db_get_value_filter ($field, $table, $filter, $where_join =
$field, $table, $field, $table,
db_format_array_where_clause_sql ($filter, $where_join)); db_format_array_where_clause_sql ($filter, $where_join));
$result = db_get_all_rows_sql ($sql); $result = db_get_all_rows_sql ($sql, $search_history_db);
if ($result === false) if ($result === false)
return false; return false;

View File

@ -271,18 +271,18 @@ function db_get_value($field, $table, $field_search = 1, $condition = 1, $search
* *
* @return mixed Value of first column of the first row. False if there were no row. * @return mixed Value of first column of the first row. False if there were no row.
*/ */
function db_get_value_filter ($field, $table, $filter, $where_join = 'AND') { function db_get_value_filter ($field, $table, $filter, $where_join = 'AND', $search_history_db = false) {
global $config; global $config;
switch ($config["dbtype"]) { switch ($config["dbtype"]) {
case "mysql": case "mysql":
return mysql_db_get_value_filter($field, $table, $filter, $where_join); return mysql_db_get_value_filter($field, $table, $filter, $where_join, $search_history_db);
break; break;
case "postgresql": case "postgresql":
return postgresql_db_get_value_filter($field, $table, $filter, $where_join); return postgresql_db_get_value_filter($field, $table, $filter, $where_join, $search_history_db);
break; break;
case "oracle": case "oracle":
return oracle_db_get_value_filter($field, $table, $filter, $where_join); return oracle_db_get_value_filter($field, $table, $filter, $where_join, $search_history_db);
break; break;
} }
} }