This commit is contained in:
Marijn Jansen
2017-02-03 11:31:18 +01:00
parent ac2ce3d07b
commit 6d5de98c1d
5 changed files with 61 additions and 5 deletions

View File

@@ -8,6 +8,7 @@ require_once "../queries/alerts.php";
*/
function createGroup()
{
// Creates the group.
$createGroup = prepareQuery("
INSERT INTO
`group_page` (`name`, `description`)
@@ -17,6 +18,7 @@ function createGroup()
$createGroup->bindValue(':description', test_input($_POST["bio"]));
$createGroup->execute();
// Gets the groupID just created.
$getGroupID = prepareQuery("
SELECT
`groupID`
@@ -28,6 +30,7 @@ function createGroup()
$getGroupID->execute();
$groupID = $getGroupID->fetch()["groupID"];
// Adds the user as an admin.
$makeUserAdmin = prepareQuery("
INSERT INTO
`group_member` (userID, groupID, role)