rpicms

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

commit 0653c9e1ff45c1ba93993fbb04a0e806372fae12
parent 11c01e239487b1da67a98d759353d46feb11ec4e
Author: MTRNord <mtrnord1@gmail.com>
Date:   Sun, 23 Nov 2014 17:25:44 +0100

fix postion of function read

Diffstat:
Mcore/backend/blog/posts.php | 55+++++++++++++++++++++++++++----------------------------
1 file changed, 27 insertions(+), 28 deletions(-)

diff --git a/core/backend/blog/posts.php b/core/backend/blog/posts.php @@ -23,36 +23,35 @@ next_id(); function next_id(){ read(); - - function read(){ + } + function read(){ + global $id, $connection, $read, $post_id_clean; + global $post_id, $post_title, $post_text, $post_author, $post_date, $post_categrory; + if ($resultat = $connection->query("SELECT * FROM posts WHERE id LIKE '$id'")) { + //echo 'SELECT * FROM posts WHERE id LIKE '.$id; + //Put database data in variables + while($daten = $resultat->fetch_object() ){ + var_dump ($daten); + $post_id = $daten->id; + $post_title = $daten->title; + $post_text = $daten->text; + $post_author = $daten->author; + $post_date = $daten->date; + $post_categrory = $daten->category; + } + $resultat->close(); + } else { global $id, $connection, $read, $post_id_clean; global $post_id, $post_title, $post_text, $post_author, $post_date, $post_categrory; - if ($resultat = $connection->query("SELECT * FROM posts WHERE id LIKE '$id'")) { - //echo 'SELECT * FROM posts WHERE id LIKE '.$id; - //Put database data in variables - while($daten = $resultat->fetch_object() ){ - var_dump ($daten); - $post_id = $daten->id; - $post_title = $daten->title; - $post_text = $daten->text; - $post_author = $daten->author; - $post_date = $daten->date; - $post_categrory = $daten->category; - } - $resultat->close(); - } else { - global $id, $connection, $read, $post_id_clean; - global $post_id, $post_title, $post_text, $post_author, $post_date, $post_categrory; - global $error; - $error = "1"; - echo "Nothing to read from Database!"; - $post_id = "Database error!"; - $post_title = "Database error!"; - $post_text = "Database error!"; - $post_author = "Database error!"; - $post_date = "Database error!"; - $post_categrory = "Database error!"; - } + global $error; + $error = "1"; + echo "Nothing to read from Database!"; + $post_id = "Database error!"; + $post_title = "Database error!"; + $post_text = "Database error!"; + $post_author = "Database error!"; + $post_date = "Database error!"; + $post_categrory = "Database error!"; } }