Absolutely losing what's left of my mind on this. I've been poring over SO for days and nothing I've tried has got me any progress ...
I have a form which includes a table where user inputs date, location, etc.:
<td class="date"><input class="datepicker" name="date[]" value="" /></td>
<td class="location"><input class="location" name="location[]" value="" /></td>
<td class="artist"><input class="artist" name="artist[]" value="" /></td>
<td class="artist-rep"><input class="artist-rep" name="artist-rep[]" value="" /></td>
<td class="add-delete-row">
<a href="#" class="delete-row" title="Delete row">Delete</a>
<a href="#" class="add-row" title="Add a row">Add Row</a>
</td>
The number of rows is inconstant, as user can add rows (jQuery). Each row represents a session date and if I ever get to that square, I'll INSERT them into a 'Sessions' table in the db.
I thought I'd be asking how to write the mySQL query but at this point I can't even echo the values using:
$date1 = $_POST['date'][0];
$date2 = $_POST['date'][1];
$date3 = $_POST['date'][2];
echo "<p class=\"debug\">date 1: " . $date1. "</p>";
echo "<p class=\"debug\">date 2: " . $date2. "</p>";
echo "<p class=\"debug\">date 3: " . $date3. "</p>";
(Nothing is echo'd).
I expect I'll have an array (rows) of arrays (session dates/details), but I'm just lost with php arrays, especially when my attempts to even get values to $_POST fails. And by the way, there are other fields in the form (outside the session dates table) which are $_POSTing just fine and getting into the db (a different table), so I don't understand why these inputs' values are MIA.
Any help much appreciated. I'll be on the bridge, eagerly awaiting help ... or a stiff gust of wind.