Skip to content

Commit 2edc862

Browse files
committed
attempt to address some sqlserver issues
1 parent 49a61fa commit 2edc862

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

framework/core/subsystems/database/sqlsvr.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function __construct($username, $password, $hostname, $database, $new=false) {
4747
} else {
4848
$host = $hostname;
4949
}
50-
if ($this->connection = sqlsrv_connect($host, array('Uid'=>$username, 'PWD'=>$password, 'Database'=>$database))) {
50+
if ($this->connection = sqlsrv_connect($host, array('UID'=>$username, 'PWD'=>$password, 'Database'=>$database))) {
5151
$this->havedb = true;
5252
}
5353
$this->prefix = DB_TABLE_PREFIX . '_';
@@ -1313,8 +1313,12 @@ function insertObject($object, $table) {
13131313
sqlsrv_fetch($queryID);
13141314
$id = sqlsrv_get_field($queryID, 0);
13151315
return $id;
1316-
} else
1316+
} else {
1317+
if (DEVELOPMENT) {
1318+
eLog($sql . ' - ' . $this->error(), 'insertObject Error');
1319+
}
13171320
return 0;
1321+
}
13181322
}
13191323

13201324
/**
@@ -1403,6 +1407,8 @@ function updateObject($object, $table, $where=null, $identifier='id', $is_revisi
14031407
}
14041408
//if ($table == 'text') eDebug($sql,true);
14051409
$res = (@sqlsrv_query($this->connection, $sql) != false);
1410+
if (DEVELOPMENT && !$res)
1411+
eLog($sql . ' - ' . $this->error(), 'updateObject Error');
14061412
return $res;
14071413
}
14081414

install/pages/install-7.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
expSettings::change('LANGUAGE', LANGUAGE);
2828

2929
$user = $db->selectObject('user', 'is_system_user=1');
30+
if (empty($user))
31+
$user = new stdClass();
3032

3133
$user->username = $_REQUEST['username'];
3234
$pwstrength = expValidator::checkPasswordStrength($_REQUEST['password']);

0 commit comments

Comments
 (0)