1
0
mirror of https://github.com/agdsn/ancient-weatherstation.git synced 2026-06-19 23:07:59 +00:00

heavy database optimizions

git-svn-id: file:///home/jan/tmp/wetterstation/trunk@243 dd492736-c11a-0410-ad51-8c26713eaf7f
This commit is contained in:
jan
2008-03-20 17:09:11 +00:00
parent cbd3151a56
commit 53e83e9fd4
8 changed files with 117 additions and 83 deletions
+7 -7
View File
@@ -20,7 +20,7 @@ class Connection{
/* Verbindung herstellen (wenn noch net besteht)*/
function _createConn(){
//print $this->conn."<br>";
#print $this->conn."<br>";
if($this->conn === NULL){
$this->conn = pg_pconnect(Config::getPgConnString())
or die('Verbindungsaufbau fehlgeschlagen: ' . pg_last_error());
@@ -37,12 +37,12 @@ class Connection{
/* Eine Zeile holen */
function fetchQueryResultLine($query){
$this->_createConn();
$result = pg_query($this->conn, $query)
or die('Abfrage fehlgeschlagen: ' . pg_last_error(). "\n<br>\nquery: '".$query."'");
$array = pg_fetch_assoc($result);
//print_r($array);
return $array;
$this->_createConn();
$result = pg_query($this->conn, $query)
or die('Abfrage fehlgeschlagen: ' . pg_last_error(). "\n<br>\nquery: '".$query."'");
$array = pg_fetch_assoc($result);
//print_r($array);
return $array;
}
/* mehrere Zeilen holen */