|
From: Benjamin C. <bc...@us...> - 2001-12-04 15:16:24
|
Update of /cvsroot/phpbt/phpbt/inc/db
In directory usw-pr-cvs1:/tmp/cvs-serv21854/inc/db
Modified Files:
pgsql.php
Log Message:
Group administration
Index: pgsql.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/inc/db/pgsql.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- pgsql.php 2001/11/30 06:06:17 1.1
+++ pgsql.php 2001/12/04 14:32:23 1.2
@@ -11,6 +11,7 @@
class DB_Sql {
var $Host = "";
+ var $Port = "";
var $Database = "";
var $User = "";
var $Password = "";
@@ -24,6 +25,7 @@
var $Errno = 0;
var $Error = "";
+ var $Debug = 0;
var $Auto_Free = 0; # Set this to 1 for automatic pg_freeresult on
# last record.
@@ -64,7 +66,7 @@
$this->connect();
-# printf("<br>Debug: query = %s<br>\n", $Query_String);
+ if ($this->Debug) printf("<br>Debug: query = %s<br>\n", $Query_String);
$this->Query_ID = pg_Exec($this->Link_ID, $Query_String);
$this->Row = 0;
@@ -203,32 +205,6 @@
print $this->Record[$Name];
}
- ## contributed Saillard Luc <luc...@al...>
-
- function nextid($seq_name) {
- $this->connect();
-
- $q_id=@pg_exec($this->Link_ID,"select nextval('$seq_name')");
- if (!$q_id) {
- if (!@pg_exec($this->Link_ID,"create sequence $seq_name")) {
- $this->halt("<BR> nextid() function - unable to create sequence");
- return 0;
- }
- $q_id=@pg_exec($this->Link_ID,"select nextval('$seq_name')");
- if (!$q_id) {
- $this->halt("<BR>pg_exec() failed:<BR>nextID function");
- return 0;
- }
- }
- $r=@pg_fetch_row($q_id, 0);
- if ($r==false)
- $nextid=0;
- else
- $nextid=$r[0];
-
- return $nextid;
- }
-
function halt($msg) {
printf("</td></tr></table><b>Database error:</b> %s<br>\n", $msg);
printf("<b>PostgreSQL Error</b>: %s (%s)<br>\n",
|