2012-03-24 Junichi Satoh <junichi@rworks.jp>

* include/db/postgresql.php: Fixed SQL error with PostgreSQL.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5828 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
jsatoh 2012-03-24 14:31:23 +00:00
parent b3bed2432d
commit e4ac6834b6
2 changed files with 7 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2012-03-24 Junichi Satoh <junichi@rworks.jp>
* include/db/postgresql.php: Fixed SQL error with PostgreSQL.
2012-03-24 Junichi Satoh <junichi@rworks.jp>
* operation/agentes/status_monitor.php: Fixed SQL error with PostgreSQL.

View File

@ -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);