diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index e468762221..c138b0e19a 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,7 @@ +2012-03-24 Junichi Satoh + + * include/db/postgresql.php: Fixed SQL error with PostgreSQL. + 2012-03-24 Junichi Satoh * operation/agentes/status_monitor.php: Fixed SQL error with PostgreSQL. diff --git a/pandora_console/include/db/postgresql.php b/pandora_console/include/db/postgresql.php index 2d3c2628d6..25c294c801 100644 --- a/pandora_console/include/db/postgresql.php +++ b/pandora_console/include/db/postgresql.php @@ -57,6 +57,9 @@ function postgresql_connect_db($host = null, $db = null, $user = null, $pass = n * @return mixed Value of first column of the first row. False if there were no row. */ function postgresql_db_get_value ($field, $table, $field_search = 1, $condition = 1, $search_history_db = false) { + if ($field_search[0] == '`') + $field_search = str_replace ('`', '', $field_search); + if (is_int ($condition)) { $sql = sprintf ("SELECT %s FROM %s WHERE %s = %d LIMIT 1", $field, $table, $field_search, $condition);