INSERT INTO projects
(Name, Description, CreationDate, EstimateDuration, CompletionDate, CreatorID, ManagerID)
VALUES
(#Name#, #Description#, php('date', 'Y-m-d H:i:s'), #EstimateDuration#,
#CompletionDate, typeHandler=DateTime#,
#CreatorUserName#, #ManagerUserName#)
select LAST_INSERT_ROWID() as value
UPDATE projects SET Disabled = 1 WHERE ProjectID = #value#
INSERT INTO project_members (UserID, ProjectID)
VALUES(#username#, #project#)
DELETE FROM project_members WHERE ProjectID = #project# AND UserID = #username#
UPDATE projects
SET
CompletionDate = #CompletionDate, typeHandler=DateTime#,
Description = #Description#,
EstimateDuration = #EstimateDuration#,
ManagerId =#ManagerUserName#,
Name = #Name#
WHERE
ProjectID = #ID#