tags:

views:

61

answers:

1

I am trying to make some table out of a multidimensional array

here is my code

http://pastebin.com/d13d62098

I am getting this error
**Warning: Invalid argument supplied for foreach()

here is an example of the array

www.pastebin.com/m3454956a

any ideas?

+1  A: 

You have an array keyed by TAC between your top array and the employee data. Easily fixed:

foreach ($employees as $tac) {
  $emp = $tac['TAC'];
  echo $emp['fname']." ".$emp['lname'];
  echo "<table>";
  foreach($emp['appts'] as $cli => $appts) {
    echo "<tr>";
    echo "<td>$cli</td>";
    echo "</tr>";
  }
  echo "</table>";
}

If TAC isn't some kind of constant (eg it's some kind of ID) then the solution will differ but there's not enough information to determine that.

cletus
It is an id.Here is the url to the full code I havewww.pastebin.com/d13d62098I tried that fix but it now won't even echo the name
Avalic