summaryrefslogtreecommitdiff
path: root/www/invite.php
diff options
context:
space:
mode:
authorroot2014-02-17 20:25:04 +0100
committerroot2014-02-17 20:25:04 +0100
commit90719f4deb17c8d89d74a7b9872764c1df081f6d (patch)
tree1bde8e81ff78ff5a17327684e5196a3c704e467a /www/invite.php
parent922521df8ac69fcf24faf799669cbc9ca9da7892 (diff)
downloadfiles.iamfabulous.de-90719f4deb17c8d89d74a7b9872764c1df081f6d.tar.gz
fixed database setup
Diffstat (limited to 'www/invite.php')
-rw-r--r--www/invite.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/www/invite.php b/www/invite.php
index 4a055e3..f77e6f6 100644
--- a/www/invite.php
+++ b/www/invite.php
@@ -41,8 +41,12 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') {
// $db->exec("INSERT INT0 user (id, name, senpai, key, status, email) VALUES (NULL, '$id', '$key', 0, '$safe_email');");
// $db->exec("UPDATE user SET invites='$invite' WHERE id='$id';");
- if($db->exec("INSERT INTO user (id, name, senpai, key, status, email) VALUES (NULL, NULL, '$id', '$key', 0, '$safe_email');") && $db->exec("UPDATE user SET invites='$invite' WHERE id='$id';"))
- {
+ if($db->exec("
+ BEGIN TRANSACTION;
+ INSERT INTO user (id, name, senpai, key, status, email) VALUES (NULL, NULL, '$id', '$key', 0, '$safe_email');
+ UPDATE user SET invites='$invite' WHERE id='$id';
+ COMMIT;
+ ")){
header("Refresh: 0; /invite?reason=success");
} else {
header("Refresh: 0; /invite?reason=database");