hello all.
I am trying to echo a table with a data for each entry in the mySQL.
I don't understand why I keep getting Invalid argument supplied for foreach() !
first I get the mySQL table:
$fetchinfo = mysql_query("SELECT * FROM users WHERE isAdmin=true ;");
$fetcharray = mysql_fetch_array($fetchinfo);
I only want to select those where isAdmin is true.
Then I create my simple table:
echo '<table border="0" cellspacing="0" cellpadding="0">';
foreach($fetcharray){
echo'<tr>';
foreach($fetcharray['Name'] as $Name){
echo'<td>$Name</td>';
}
foreach($fetcharray['LastName'] as $LastName){
echo'<td>$LastName</td>';
}
echo'</tr>';
}
echo'</table>';