rpicms

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

commit 5af4f40a5367123a1e04b504d494247462e23d4d
parent 78e3abc8a88d516464be88eea9294c5db8c64002
Author: MTRNord <mtrnord1@gmail.com>
Date:   Sun, 23 Nov 2014 17:00:37 +0100

will it work?

Diffstat:
Mcore/backend/blog/posts.php | 10+---------
1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/core/backend/blog/posts.php b/core/backend/blog/posts.php @@ -26,7 +26,7 @@ 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')) { + 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() ){ @@ -42,11 +42,6 @@ } 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')) { - while($daten = $resultat->fetch_object() ){ - //If no data in Database give error - echo 'SELECT * FROM posts WHERE id LIKE '.$id; - var_dump ($daten); global $error; $error = "1"; echo "Nothing to read from Database!"; @@ -56,9 +51,6 @@ $post_author = "Database error!"; $post_date = "Database error!"; $post_categrory = "Database error!"; - } - $resultat->close(); - } } if ($read != 0 && $id < $post_id_clean){ read();