I have a page, that asks for start and end dates and a category, and then gives me a table.
It posts the var back to itself, but I have to click the button twice.
I don’t know if this complicates it, but I want to continue using that page with new dates.
I attached the entire code, but I’ll try to post the pertinent parts.
https://dl.dropboxusercontent.com/u/7834798/Attendance.php
[php]$dStartDate = $_POST[‘StartDate’];
$dEndDate = $_POST[‘EndDate’];
$group_id = $_POST[‘group_id’];
?>
…
<?php mysqli_multi_query($dbc, $query); if(isset($_POST['AttendanceSubmit'])){ // button name $query2 = mysql_query("SELECT pers_id , pers_name, pers_date, pers_date_attend_ind FROM pers_dates") or die(mysql_error()); while($row = mysql_fetch_array($query2)) $rows[] = $row; foreach($rows as $key => $value) { $array[$value['pers_id']]['name'] = $value['pers_name']; $array[$value['pers_id']]['dates'][$value['pers_date']] = $value['pers_date_attend_ind']; } //$rowColor = "brown"; function generate_table($array) { $html = ''; foreach($array as $key => $value) { $html .= ''; foreach($value['dates'] as $k => $v) { //Date of meeting $html .= ' | ' .' '. $k .' '. ' | '; } $html .= '
' . $value['name'] . ' | '; foreach($value['dates'] as $v) { //attendance indicator $html .= '' . $v .' ' . ' | '; } $html .= '