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:Code:Array ( Array ( [name] => Phil [email] => [email protected] [company] => VNL ) Array ( [name] => Phil [email] => [email protected] [company] => Norm's World ) Array ( [name] => Ppeter [email] => [email protected] [company] => Norm's World ) Array ( [name] => Norm [email] => [email protected] [company] => Norm's World ) Array ( [name] => Webby Guy [email] => [email protected] [company] => VNI ) )
The table gets written out fine, but I get an infinite loop that gives me this error: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";
}
I figure I'm probably missing something obvious. Any help appreciated,Warning: Invalid argument supplied for foreach() in <snip>loop.php on line 205
Thanks, Norm




Reply With Quote