-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrsvpUpdate.php
35 lines (32 loc) · 1.07 KB
/
rsvpUpdate.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
$valueOne;
$partyComment = $_POST['TheseComment'];
$partySize = $_POST['LengthOfParty'];
$partyNumber = $_POST['NumOfParty'];
$personName;
$x=1;
$con = mysql_connect("localhost","brettsco","funkadelic37");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("brettsco_GuestsOne", $con);
while($x <= $partySize)
{
if (isset($_POST['optionsRadios'.$x]))
{ // if ANY of the options was checked
$personName = $_POST['thisName'.$x];
$valueOne = $_POST['optionsRadios'.$x];
} // echo the choice
else
{
echo "nothing was selected.";
}
mysql_query("UPDATE fullGuests SET Attending='".$valueOne."' WHERE fullName='".$personName."' AND partyNumber='".$partyNumber."';");
mysql_query("UPDATE fullGuests SET hasResponded='".$personName."' WHERE fullName='".$personName."' AND partyNumber='".$partyNumber."';");
mysql_query("UPDATE fullGuests SET groupComment='".$partyComment."' WHERE fullName='".$personName."' AND partyNumber='".$partyNumber."';");
$x++;
}
header('Location: http://www.brettscoresatd.com/index.html?modal=reponseModal');
exit();
?>