Private GIT

Skip to content
Snippets Groups Projects
Commit 355b0ac5 authored by Jean-Baptiste's avatar Jean-Baptiste Committed by Matthieu Kermagoret
Browse files

Fix condition - Error query BDD

Hi,
If there was an error during an SQL query, do not make a "fetch".
Regards
parent 38898d15
No related branches found
Tags
No related merge requests found
...@@ -325,11 +325,12 @@ class CentreonGMT ...@@ -325,11 +325,12 @@ class CentreonGMT
"AND `session_id` = '" . CentreonDB::escape($sid) . "' LIMIT 1"); "AND `session_id` = '" . CentreonDB::escape($sid) . "' LIMIT 1");
if (PEAR::isError($DBRESULT)) { if (PEAR::isError($DBRESULT)) {
$this->myGMT = 0; $this->myGMT = 0;
} } else {
$info = $DBRESULT->fetchRow(); $info = $DBRESULT->fetchRow();
$DBRESULT->free(); $DBRESULT->free();
$this->myGMT = $info["contact_location"]; $this->myGMT = $info["contact_location"];
} }
}
/** /**
* *
...@@ -351,10 +352,11 @@ class CentreonGMT ...@@ -351,10 +352,11 @@ class CentreonGMT
"WHERE `contact`.`contact_id` = " . $userId ." LIMIT 1"); "WHERE `contact`.`contact_id` = " . $userId ." LIMIT 1");
if (PEAR::isError($DBRESULT)) { if (PEAR::isError($DBRESULT)) {
$this->myGMT = 0; $this->myGMT = 0;
} } else {
$info = $DBRESULT->fetchRow(); $info = $DBRESULT->fetchRow();
$DBRESULT->free(); $DBRESULT->free();
$this->myGMT = $info["contact_location"]; $this->myGMT = $info["contact_location"];
}
} else { } else {
$this->myGMT = 0; $this->myGMT = 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment