Learning nested foreach loops

See comments in code.
This commit is contained in:
mattbk
2015-10-30 09:09:57 -05:00
parent 317f4fb579
commit 86c46fb736

View File

@ -95,10 +95,20 @@ switch ($mode) {
$query->execute() or die('Could not execute query:<br>'.mysqli_error($db)); $query->execute() or die('Could not execute query:<br>'.mysqli_error($db));
$query->close(); $query->close();
//Debugging I think?
//Loop through $results better
//This is not done yet, but shows an example of a loop you could put a query statement in.
foreach ($_SESSION['results'] as $name => $value) {
foreach ($value as $n2 => $v2) {
echo $name.$n2.$v2;
}
}
//Debugging I think?
$variables['debug'] = $_SESSION['results']; $variables['debug'] = $_SESSION['results'];
break; break;
case 'results': case 'results':
$download = isset($_GET['download']); $download = isset($_GET['download']);