Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $db = new mysqli(" ", " ", " ", "volsched");
- if ($db->connect_errno) {
- echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
- }
- $stmt = $db->prepare('UPDATE volConfirm SET confirmed = "YES" WHERE email = ?');
- if (!$mysqli->error) {
- printf("Errormessage: Email not in system %s\n", $mysqli->error);
- }
- $stmt->bind_param('s', $_POST['email']);
- $stmt->execute();
- $stmt = $db->prepare('SELECT agreename, position, shift_times, confirmed from volConfirm WHERE email = ?');
- $stmt->bind_param('s', $_POST['email']);
- $stmt->execute();
- $stmt->bind_result($agreeName, $position, $shift_times, $confirmed);
- while ($stmt->fetch()) {
- // construct your output here using $row to access database record
- echo "<h2>" . $agreeName . "</h2>";
- echo "<p> You have been assigned as a volunteer for:" . $position . "</p>";
- echo "<p>Your shift times are scheduled for:" . $shift_times . "</p>";
- echo "<p>Your shift has been confirmed:" . $confirmed . "</p>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement