diff --git a/lib/dml/database_column_info.php b/lib/dml/database_column_info.php index c1d7c9ffced..e7e19879db7 100644 --- a/lib/dml/database_column_info.php +++ b/lib/dml/database_column_info.php @@ -133,7 +133,7 @@ class database_column_info { */ public function __construct($data) { foreach ($data as $key=>$value) { - if (property_exists($key, $this)) { + if (property_exists($this, $key)) { $this->$key = $value; } } diff --git a/lib/dml/pgsql_native_moodle_database.php b/lib/dml/pgsql_native_moodle_database.php index 8ed84712492..044c32a405f 100644 --- a/lib/dml/pgsql_native_moodle_database.php +++ b/lib/dml/pgsql_native_moodle_database.php @@ -177,14 +177,14 @@ class pgsql_native_moodle_database extends moodle_database { $result = pg_query($this->pgsql, $sql); $this->query_end($result); - $this->bytea_oid = pg_fetch_result($result, 0); + $this->bytea_oid = pg_fetch_result($result, 0, 0); pg_free_result($result); if ($this->bytea_oid === false) { $this->pgsql = null; throw new dml_connection_exception('Can not read bytea type.'); } - // Connection stabilished and configured, going to instantiate the temptables controller + // Connection stabilised and configured, going to instantiate the temptables controller $this->temptables = new pgsql_native_moodle_temptables($this); return true;