commit 33d12b0d353fd6609b52903269c371ae820ce465
parent 67cd837a9114c2ee70cdf355cfcec41911114678
Author: MTRNord <mtrnord1@gmail.com>
Date: Fri, 16 Jan 2015 20:06:41 +0100
now it should work correct
Diffstat:
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/core/backend/admin/blog/newpost.php b/core/backend/admin/blog/newpost.php
@@ -22,6 +22,10 @@ include($root . '/core/config/variables.config.php');
include($root . '/core/config/connect.db.inc.php');
while (ob_get_status()) {
+ if (mysqli_connect_errno()) {
+ printf("Verbindung fehlgeschlagen: %s\n", mysqli_connect_error());
+ exit();
+ }
if ($resultat = $connection->query('SELECT id FROM posts')) {
while($daten = $resultat->fetch_object() ){
$post_id_clean = $daten->id;
@@ -37,11 +41,9 @@ while (ob_get_status()) {
$text = $_POST['content'];
$category = $_POST['category'];
- //if (!empty($author) || !empty($title) || !empty($text) || !empty($category)) {
- if ($resultat = $connection->query("INSERT INTO posts (id,text,title,author,date,category) VALUES ('$ids', '$text', '$title', '$author', 'Now();', '$category')")) {
- $resultat->close();
- }
- //}
+ if ($resultat = $connection->query("INSERT INTO posts (id,text,title,author,date,category) VALUES ('$ids', '$text', '$title', '$author', 'Now();', '$category')")) {
+ }
+ $connection->close();
ob_end_clean();
}
//header( "Location: ../../../../" );