diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 4b999ec489..1ab7a9421d 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2010-04-14 Miguel de Dios + + * include/functions_db.php: fixed bug in the function "get_db_value_filter" + when the field's name is a reserve word of mysql crash. + 2010-04-14 Sergio Martin * include/javascript/pandora_modules.js: Typo fix for bug 2953348 diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index e7da75ff54..116e07e49c 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -1671,7 +1671,7 @@ function get_db_value_filter ($field, $table, $filter, $where_join = 'AND') { unset ($filter['limit']); unset ($filter['offset']); - $sql = sprintf ("SELECT %s FROM %s WHERE %s LIMIT 1", + $sql = sprintf ("SELECT `%s` FROM %s WHERE %s LIMIT 1", $field, $table, format_array_to_where_clause_sql ($filter, $where_join)); $result = get_db_all_rows_sql ($sql);