summaryrefslogtreecommitdiff
path: root/www/add.php
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2018-07-07 13:26:02 +0000
committerIan C <ianc@noddybox.co.uk>2018-07-07 13:26:02 +0000
commit62d926e022aaf35be029f20568e55533caee3bf7 (patch)
tree58b4dcb2de9f91f7af0f1b5893cea5aa07d7a4ea /www/add.php
parent9bd1ad2bfb807d7714e17112a9dc51f2416a1e6c (diff)
Added up/down links to reorder entries.
Diffstat (limited to 'www/add.php')
-rw-r--r--www/add.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/www/add.php b/www/add.php
index 7b9d99f..e5c1a18 100644
--- a/www/add.php
+++ b/www/add.php
@@ -34,7 +34,7 @@ try
$cmd = $db->prepare("INSERT INTO pm_store " .
"(description, groupname, username, password) ".
- "values " .
+ "VALUES " .
"(:description, :group, :username, :password)");
$cmd->bindParam(":description", $description);
$cmd->bindParam(":group", $group);
@@ -42,7 +42,13 @@ try
$cmd->bindParam(":password", $password);
$cmd->execute();
- $result["id"] = $db->lastInsertId();
+ $id = $db->lastInsertId();
+
+ $result["id"] = $id;
+
+ $update = $db->prepare("UPDATE pm_store SET display = :id WHERE id = :id");
+ $update->bindParam(":id", $id);
+ $update->execute();
$db = null;
}