commit 009968d128c6414139a39d56ac13fb9a3e299710 parent baf02cb604b82a456fe227ccbf86a9af516620df Author: MTRNord <mtrnord1@gmail.com> Date: Sun, 23 Nov 2014 11:04:00 +0100 try with arrays (didn't worked before with them :/) Diffstat:
| M | core/backend/blog/posts.php | | | 18 | ++++++++++++------ |
| M | themes/jumbotron/index.php | | | 4 | ---- |
2 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/core/backend/blog/posts.php b/core/backend/blog/posts.php @@ -18,12 +18,18 @@ if ($resultat = $connection->query('SELECT * FROM posts')) { //Put database data in variables while($daten = $resultat->fetch_object() ){ - $post_id = $daten->id; - $post_title = $daten->title; - $post_text = $daten->text; - $post_author = $daten->author; - $post_date = $daten->date; - $post_categrory = $daten->category; + $post_id_clean = $daten->id; + $post_title_clean = $daten->title; + $post_text_clean = $daten->text; + $post_author_clean = $daten->author; + $post_date_clean = $daten->date; + $post_categrory_clean = $daten->category; + + $post_id = [ + "$post_id_clean" => "$post_id_clean" + ] + + } $resultat->close(); } else { diff --git a/themes/jumbotron/index.php b/themes/jumbotron/index.php @@ -77,11 +77,7 @@ <div class="container"> <h1> <?php - $x = 0; - while ($x < $post_id){ echo "<a href='index.php?id=$post_id' rel='bookmark'> $post_title </a>"; - $x = $x + 1; - } ?> </h1> <div>