projects
/
misc
/
kostenrechnung
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
714766d
)
Global function for querying the database
author
Joey Schulze
<joey@infodrom.org>
Thu, 25 Feb 2010 11:30:09 +0000
(12:30 +0100)
committer
Joey Schulze
<joey@infodrom.org>
Thu, 25 Feb 2010 11:30:09 +0000
(12:30 +0100)
lib/general.php
patch
|
blob
|
history
diff --git
a/lib/general.php
b/lib/general.php
index
c296728
..
fa250f8
100644
(file)
--- a/
lib/general.php
+++ b/
lib/general.php
@@
-42,6
+42,19
@@
function connect_db()
pg_connect($dsn);
}
+function query_db($sql)
+{
+ $sth = pg_query($sql);
+
+ if ($sth === false) return false;
+
+ $result = array();
+ while ($row = pg_fetch_assoc($sth))
+ $result[] = $row;
+
+ return $result;
+}
+
function load_js($jsfiles, $jscode)
{
$ret = '';