Guest User

Untitled

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