rpicms

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

commit cdfd8484e224c83c732cab1d7ef5b2b71f79a35a
parent fc2ed90fa85e7ddcc351ed439b967fe6d5235ead
Author: MTRNord <mtrnord1@gmail.com>
Date:   Thu, 19 Mar 2015 21:28:08 +0100

fix sql

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

diff --git a/core/api/v1/DbHandler.class.php b/core/api/v1/DbHandler.class.php @@ -240,10 +240,9 @@ class DbHandler { * @param String $task_id id of the task */ public function getPosts($post_id) { - if ($resultat = $connection->query('SELECT id FROM posts')) { - while($daten = $resultat->fetch_object() ){ - $post_id_clean = $daten->id; - } + $id = $this->conn->prepare("SELECT id FROM posts"); + if ($stmt->execute()) { + $post_id_clean = $id->get_result()->fetch_assoc(); } if ($post_id == NULL) { $x = 1;