From 86c46fb7364c77cb616000e7592a28bfec612458 Mon Sep 17 00:00:00 2001 From: mattbk Date: Fri, 30 Oct 2015 09:09:57 -0500 Subject: [PATCH] Learning nested foreach loops See comments in code. --- index.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 8493b6b..cc1f709 100755 --- a/index.php +++ b/index.php @@ -95,9 +95,19 @@ switch ($mode) { $query->execute() or die('Could not execute query:
'.mysqli_error($db)); $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']; - + + break; case 'results':