Ich bin mit den undefinierten Indexprobleme konfrontiert. Ich habe meinen HTML-Code überprüft, sieht gut aus.Verwendung von undefinierten Konstante in submit Website
aber es zeigt nach wie vor das Problem, wenn ich versuche, der Seite
das Hauptproblem, sie zu aktualisieren ist, wenn ich die Seite aktualisieren,
zeigt es so etwas wie dieser
Hinweis: undefined index: Bild in /Applications/XAMPP/xamppfiles/htdocs/cms/admin/includes/edit_post.php on line 31
Hinweis: undefinierte ed Index: Bild in /Applications/XAMPP/xamppfiles/htdocs/cms/admin/includes/edit_post.php on line 32
QUERY FAILED .You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '= '2', post_title = 'javascript', post_date = now(), post_author = 'Winter', pos' at line 1
So, Im ziemlich sicher, ich habe einige Syntax Problem auf diese Abfrage Linie, vielleicht habe ich vergessen, etwas Platz in einer Zeile hinzuzufügen?
Ich glaube, die Funktion confirm() ist in Ordnung, es ist nur ein Funktionsname.
$query ="UPDATE posts SET";
$query .="post_category_id = '{$post_category_id}', ";
$query .="post_title = '{$post_title}', ";
$query .="post_date = now(), ";
$query .="post_author = '{$post_author}', ";
$query .="post_status = '{$post_status}', ";
$query .="post_tags = '{$post_tags}' , ";
$query .="post_content = '{$post_content}', ";
$query .="post_image ='{$post_image}' ";
$query .="WHERE post_id = {$the_post_id} ";
$update_post = mysqli_query($connection,$query);
confirm($update_post);
// if(! $update_post) // die("QUERY FAILED" . mysqli_error($connection));
Dies ist das Bild form Gruppe HTML-Code
ich den Namen checked = "post_image" sie scheint Spiel.
Und ich überprüfte andere Frage, aber immer noch nicht verstehen, warum eine Notiz hier haben.
$query = "SELECT * FROM posts WHERE post_id = $the_post_id ";
$select_posts_by_id = mysqli_query($connection,$query);
while($row = mysqli_fetch_assoc($select_posts_by_id)){
$post_image = $row['post_image'];
}
if(isset($_POST['update_post'])){
$post_image = $_FILES['image']['name'];
$post_image_temp = $_FILES['image']['tmp_name'];
move_uploaded_file($post_image_temp, "../images/$post_image");
}
<div class="form-group">
<label for="post_image">Post Image</label>
<img width="100" src="../images/<?php echo $post_image ?>" alt="" >
<input type="file" name="post_image">
</div>