From 0d3cfc461c09458d454ac7a87fb840bf6351fd05 Mon Sep 17 00:00:00 2001 From: jsatoh Date: Sun, 25 Mar 2012 00:59:34 +0000 Subject: [PATCH] 2012-03-25 Junichi Satoh * include/db/postgresql.php: Fixed bad syntax for WHERE clause in postgresql_db_format_array_where_clause_sql(). * include/functions_config.php: Back to previous version, because fixed bad sql in include/db/postgresql.php. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5829 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 8 ++++++++ pandora_console/include/db/postgresql.php | 2 +- pandora_console/include/functions_config.php | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index c138b0e19a..98625fabad 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,11 @@ +2012-03-25 Junichi Satoh + + * include/db/postgresql.php: Fixed bad syntax for WHERE clause in + postgresql_db_format_array_where_clause_sql(). + + * include/functions_config.php: Back to previous version, because + fixed bad sql in include/db/postgresql.php. + 2012-03-24 Junichi Satoh * include/db/postgresql.php: Fixed SQL error with PostgreSQL. diff --git a/pandora_console/include/db/postgresql.php b/pandora_console/include/db/postgresql.php index 25c294c801..0027aae38c 100644 --- a/pandora_console/include/db/postgresql.php +++ b/pandora_console/include/db/postgresql.php @@ -540,7 +540,7 @@ function postgresql_db_format_array_where_clause_sql ($values, $join = 'AND', $p foreach ($values as $field => $value) { if (is_numeric ($field)) { /* User provide the exact operation to do */ - $query .= $value; + $query .= sprintf ("%s = %d", $field, $value); if ($i < $max) { $query .= ' '.$join.' '; diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index eb37170c13..40b0a619c3 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -677,7 +677,7 @@ function config_check (){ $now = date("U"); // First action in order to know if it's a new installation or db maintenance never have been executed - $first_action = db_get_value_filter('utimestamp', 'tsesion', array('1' => 'true', 'order' => 'id_sesion ASC')); + $first_action = db_get_value_filter('utimestamp', 'tsesion', array('1' => '1', 'order' => 'id_sesion ASC')); $fresh_installation = $now - $first_action; $resta = $now - $db_maintance;