T1703311302

This commit is contained in:
Leander
2017-03-31 13:03:01 +02:00
parent d09fc0fe1e
commit d79b9f8f23
2 changed files with 11 additions and 3 deletions

View File

@@ -18,7 +18,8 @@
$error = 11101;
} else {
$database->query('INSERT INTO "Users" ("name", "ID") VALUES ($1, $2);', array($name, $uid));
if(preg_match('/violates unique constraint "Users_name"/', pg_last_error()) == 1) {
print pg_last_error();
if(preg_match('/violates unique constraint "Users_name_unique"/', pg_last_error()) == 1) {
$error = 11102;
} else {
$data = array('uid' => $uid, 'name' => $name);