Advertisement
Anteks12345

Untitled

Aug 28th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $statement = $pdo->prepare("INSERT INTO todos (name, description, assignedTo, completed) VALUES(:name, :description, :assignedTo, :completed)");
  2.  
  3.  
  4. $formName = $_POST['name'];
  5.  
  6. $formDescription = $_POST['description'];
  7.  
  8. $formAssignedTo = $_POST['assignedTo'];
  9.  
  10. if ($_POST['completed'] == "true") {
  11.     $formCompleted = true;
  12. } else {
  13.     $formCompleted = false;
  14. }
  15.  
  16. $statement->bindParam(':name', $formName);
  17. $statement->bindParam(':description', $formDescription);
  18. $statement->bindParam(':assignedTo', $formAssignedTo);
  19. $statement->bindParam(':completed', $formCompleted);
  20.  
  21. #$statement = $pdo->prepare("select * from todos");
  22.  
  23. $statement->execute();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement