whats up everybody? im using the Web Database Applications: with PHP and MySQL book and tried to modify their generic browse function to make a front-end that looks at a table 20 records at a time. suffice it to say, i can't get it to work. the function is in a seperate file functions2.php. the error messages i am getting tho are related to the 2 foreach loops in the function.
heres the first one
// (4b) print out the column headers from $header
foreach ($header as $element)
{
echo "\n\t<th>" . $element["header"] . "</th>";
}
echo "\n</tr>";
and the second one
// (5b) for each of the attributes in a row
foreach($header as $element)
{
echo "\n\t<td>";
// get the database attribute name for the
// current attribute
$temp = $element["attrib"];
// print out the value of the current attribute
echo $row["$temp"];
echo "</td>";
} // end foreach attribute
echo "\n</tr>\n";
which is inside of a for loop. the error messages im getting are
Warning: Invalid argument supplied for foreach() in /shared/homedir/henry/public_html/functions2.php on line 55
Warning: Invalid argument supplied for foreach() in /shared/homedir/henry/public_html/functions2.php on line 71
its straight outta the book so im not sure what im doing wrong. any ideas?