From 0dc4797a4cbc91467ec2d9816d102942ddc0605f Mon Sep 17 00:00:00 2001 From: Robert Ros Date: Sat, 20 Sep 2014 16:38:41 +0200 Subject: [PATCH] Fix the PostgreSQL install errors --- install/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install/index.php b/install/index.php index 1ae782a..ba7c4b0 100755 --- a/install/index.php +++ b/install/index.php @@ -141,16 +141,16 @@ else if (isset($_POST['install'])) { } // create database structure - $query = executeQuery($handle, $sql_structure, array()); + $query = $handle->exec($sql_structure); // Create user $handle->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - $sql = 'INSERT INTO users (username, password, name) VALUES (?, ?, ?)'; + $sql = "INSERT INTO users (username, password, name, email) VALUES (?, ?, ?, '')"; $params = array($username, $salted_password, $username); $query = executeQuery($handle, $sql, $params); - $id_user = $handle->lastInsertId(); + $id_user = (int)$handle->lastInsertId('users_id_seq'); $sql = 'INSERT INTO users_config ( user_id, name, value ) VALUES (?, ?, ?)'; $params = array($id_user, 'pager', '10');