summaryrefslogtreecommitdiff
path: root/db.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-09-07 14:31:21 +0100
committerAndrew Dolgov <[email protected]>2005-09-07 14:31:21 +0100
commit8158c57a8e3a40338045e0b809bca42f1e703ca5 (patch)
treed47c8e8cb0132d037139c34d29c956fca9c8b318 /db.php
parent4b3dff6ed580a7c5aec8fb50467043962861e0e7 (diff)
update schema, more mysql work
Diffstat (limited to 'db.php')
-rw-r--r--db.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/db.php b/db.php
index cfb289e0c..d739aa9b2 100644
--- a/db.php
+++ b/db.php
@@ -20,7 +20,7 @@ function db_escape_string($s) {
if (DB_TYPE == "pgsql") {
return pg_escape_string($s);
} else {
- return mysql_escape_string($s);
+ return mysql_real_escape_string($s);
}
}
@@ -32,6 +32,14 @@ function db_query($link, $query) {
}
}
+function db_query_2($query) {
+ if (DB_TYPE == "pgsql") {
+ return pg_query($query);
+ } else if (DB_TYPE == "mysql") {
+ return mysql_query($link);
+ }
+}
+
function db_fetch_assoc($result) {
if (DB_TYPE == "pgsql") {
return pg_fetch_assoc($result);
@@ -43,9 +51,9 @@ function db_fetch_assoc($result) {
function db_num_rows($result) {
if (DB_TYPE == "pgsql") {
- return pg_num_rows($link, $query);
+ return pg_num_rows($result);
} else if (DB_TYPE == "mysql") {
- return mysql_num_rows($link, $query);
+ return mysql_num_rows($result);
}
}