I am really tearing my hair out and I wondered if anyone can see what I am doing wrong. I have a form which fills an array "Rehearsals". So far so good. If after I press submit, I recover the values of rehearsal, I can get a print_r of the variable, but the variable itself has no contents so:
$rhearsal = $_POST['rehearsal'];
foreach($rhearsal as $row) {
print_r($row);
echo "<br>plan:" . $row->plan . "<br><br>";
}
Gives the output:
Array (
[Name] => A***** M*****
[Rehearsal_no] => 1
[Rehearsal] => Spring15-150106-1900
[plan] => Yes
[actual] => Yes
)
plan:
In other words, the variable exists in $row when I print it using print_r, but when I try to access it with $row->plan it has a null value.
I have done this lots of times before with variables, but not with input forms. If it is any help, the input form is of the form: <input type='hidden' name='rehearsal[$counter][Name]' value='$usern'>where $counter is an incrementing counter.
Anyone got any ideas - I have wasted a day trying to figure this out - typing and retyping in different ways. Thanks :)
$row['plan']since$rowis anarray, not an objecterror_reporting(E_ALL); ini_set('display_errors', '1');