Fixed a problem with creating a fresh database on pgsql

This commit is contained in:
jengo 2000-10-17 23:16:47 +00:00
parent e1c60e9daf
commit 8c677fa8ce
2 changed files with 8 additions and 10 deletions

View File

@ -11,11 +11,9 @@
/* $Id$ */
$sql = "CREATE TABLE config (
config_name varchar(25),
config_value varchar(100),
UNIQUE (config_name)
config_name varchar(25) NOT NULL UNIQUE,
config_value varchar(100) NOT NULL
)";
$db->query($sql);

View File

@ -33,8 +33,8 @@
$db->Halt_On_Error = "no";
if (!isset($oldversion)){
$db->query("select app_version from applications where app_name='admin'");
$db->next_record();
@$db->query("select app_version from applications where app_name='admin'");
@$db->next_record();
$oldversion = $db->f("app_version");
}
@ -201,10 +201,10 @@
Header("Location: $PHP_SELF?action=regularversion");
}
}else{
$db->query("select * from config");
if ($db->num_rows() == 0){
$db->query("select * from accounts");
if ($db->num_rows() == 0){
@$db->query("select * from config");
if (@$db->num_rows() == 0){
@$db->query("select * from accounts");
if (@$db->num_rows() == 0){
echo "<html><head><title>phpGroupWare Setup</title></head>\n";
echo "<body bgcolor='#ffffff'>\n";
echo "<table border=\"0\" align=\"center\">\n";