diff options
Diffstat (limited to 'www/add.php')
-rw-r--r-- | www/add.php | 10 |
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; } |