From ee7ffeb51035ecfc466f7c70103c5830e078935f Mon Sep 17 00:00:00 2001 From: DoggersHusky Date: Sun, 24 Jan 2016 15:28:32 -0400 Subject: [PATCH] menu script clean up menu script clean up and using content class --- _notes/dwsync.xml | 2 +- test 2 - menu.php | 25 +++---------------------- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/_notes/dwsync.xml b/_notes/dwsync.xml index 30f15c5..1ec2a28 100644 --- a/_notes/dwsync.xml +++ b/_notes/dwsync.xml @@ -3,5 +3,5 @@ - + \ No newline at end of file diff --git a/test 2 - menu.php b/test 2 - menu.php index 22091cf..f188a65 100644 --- a/test 2 - menu.php +++ b/test 2 - menu.php @@ -1,30 +1,11 @@ query("SELECT * FROM pages ORDER BY position"); - - $outp = "["; - - while ($rs = $results->fetch_array(MYSQLI_ASSOC)) { - if ($outp != "[") { - $outp .= ","; - } - $outp .= '{"ID":"' . htmlspecialchars_decode($rs["ID"], ENT_QUOTES) . '",'; - $outp .= '"pageLinkName":"' . htmlspecialchars_decode($rs["pageLinkName"], ENT_QUOTES) . '",'; - $outp .= '"linkUnderPage":"' . htmlspecialchars_decode($rs["linkUnderPage"], ENT_QUOTES) . '",'; - $outp .= '"page":"' . htmlspecialchars_decode($rs["page"], ENT_QUOTES) . '",'; - $outp .= '"pageMenu":"' . htmlspecialchars_decode($rs["pageMenu"], ENT_QUOTES) . '",'; - $outp .= '"position":"' . htmlspecialchars($rs["position"], ENT_QUOTES) . '"}'; - } - $outp .= "]"; - - - - $conn->close(); - echo $outp; \ No newline at end of file + echo $results = $conn->content("SELECT * FROM pages ORDER BY position");