Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $statement = $pdo->prepare("INSERT INTO todos (name, description, assignedTo, completed) VALUES(:name, :description, :assignedTo, :completed)");
- $formName = $_POST['name'];
- $formDescription = $_POST['description'];
- $formAssignedTo = $_POST['assignedTo'];
- if ($_POST['completed'] == "true") {
- $formCompleted = true;
- } else {
- $formCompleted = false;
- }
- $statement->bindParam(':name', $formName);
- $statement->bindParam(':description', $formDescription);
- $statement->bindParam(':assignedTo', $formAssignedTo);
- $statement->bindParam(':completed', $formCompleted);
- #$statement = $pdo->prepare("select * from todos");
- $statement->execute();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement