include 'connect.php'; //write code that updates the confirmed table $carpoolid = $_POST['carpoolid']; if ($carpoolid != "") { $passengerid = $_POST['passenger']; $confirm = $_POST['confirm']; echo "update confirmed set confirmed = '$confirm' where carpoolid = '$carpoolid' and passengerid = '$passengerid'"; $sql = mysql_query("update confirmed set confirmed = '$confirm' where carpoolid = '$carpoolid' and passengerid = '$passengerid'"); if (!sql) echo mysql_error(); echo "Thank you"; exit(); } $id = $_GET['id']; $passenger = $_GET['passenger']; //display everything in carpool table... query db and while loop $sql = mysql_query("select * from carpool where carpoolid = '$id'"); $row = mysql_fetch_array($sql); $people = $row[2]; $passarray = explode(",",$people); foreach ($passarray as $ind) { $arraysql = mysql_query("select name from users where id = '$ind'"); $name = mysql_fetch_row($arraysql); $name = $name[0]; $peoplelist .= "$name,"; } $peoplelist = substr($peoplelist,0,-1); $depart = $row[4]; $arrive = $row[5]; $proposerid = $row[1]; //if I have the proposer id, I have their name and email $subsql = mysql_query("select name, email, proximity, highway from users where id = '$proposerid'"); $subrow = mysql_fetch_array($subsql); $propname = $subrow[0]; $propemail = $subrow[1]; $propprox = $subrow[2]; $prophwy = $subrow[3]; ?>
Name
Email
Proximity to Highway
Rider List
Depart
Arrive
miles from
Click to confirm your participation
Click to deny this carpool