Invalid argument supplied for foreach()
Here is what I have...
An array - $result_array
..and then I have a for and foreach which write the contents of each array within the $result_array array to a table:
PHP Code:
for ($c = 0; $c <= $result_array; $c++) {
echo " <tr>\n";
foreach ($result_array[$c] as $data){
echo " <td>$data</td>\n";
}
echo " </tr>\n";
}
The table gets written out fine, but I get an infinite loop that gives me this error:
Quote:
Warning: Invalid argument supplied for foreach() in <snip>loop.php on line 205
I figure I'm probably missing something obvious. Any help appreciated,
Thanks, Norm