rpicms

A CMS for the Raspberry Pi
git clone git://archive.git.mtrnord.blog/RpicmsTeam/rpicms.git
Log | Files | Refs | README | LICENSE

commit 0b88a393503ebae30036eb3a59005a2a4151f681
parent 083e358cc6a0b47376816806cb710d667a55cc5d
Author: MTRNord <mtrnord1@gmail.com>
Date:   Fri, 20 Mar 2015 18:11:47 +0100

more improvements

Diffstat:
Mcore/api/v1/DbHandler.class.php | 14+++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/core/api/v1/DbHandler.class.php b/core/api/v1/DbHandler.class.php @@ -248,24 +248,24 @@ class DbHandler { } if ($post_id == NULL) { $x = 1; - $id = 1; + $id = 0; while ($x < $post_id_clean+1){ $stmt = $this->conn->prepare("SELECT id,title,text,author,category,date FROM posts WHERE id = ?"); $stmt->bind_param("i", $id); - $x = $x+1; - $id = $id+1; if ($stmt->execute()) { - $post["$x"] = $stmt->get_result()->fetch_assoc(); + $post["$id"] = $stmt->get_result()->fetch_assoc(); - if ($post["$x"]["text"] != NULL){ - $post["$x"]["text"] = html_entity_decode($post["text"]); + if ($post["$id"]["text"] != NULL){ + $post["$id"]["text"] = html_entity_decode($post["text"]); }else{ - $post["$x"] = NULL; + $post["$id"] = NULL; } $stmt->close(); } + $x = $x+1; + $id = $id+1; } if ($id == $post_id_clean+1){ return $post;