commit 0dbf7495d5166ae48f99d6649eb0749231c39f0c parent 84cade237e399729adabfe6a6dfce72c0cc4bc87 Author: MTRNord <mtrnord1@gmail.com> Date: Sun, 23 Nov 2014 15:23:46 +0100 one more try to fix it Diffstat:
| M | core/backend/blog/posts.php | | | 30 | ++++++++++++++++-------------- |
1 file changed, 16 insertions(+), 14 deletions(-)
diff --git a/core/backend/blog/posts.php b/core/backend/blog/posts.php @@ -40,20 +40,22 @@ } $resultat->close(); } else { - 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!"; - $post_id = "Database error!"; - $post_title = "Database error!"; - $post_text = "Database error!"; - $post_author = "Database error!"; - $post_date = "Database error!"; - $post_categrory = "Database error!"; - } + 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!"; + $post_id = "Database error!"; + $post_title = "Database error!"; + $post_text = "Database error!"; + $post_author = "Database error!"; + $post_date = "Database error!"; + $post_categrory = "Database error!"; + } + } $resultat->close(); } if ($read != 0){