未定義のインデックスの問題に直面しています。私は自分のhtmlイメージコードをチェックして、うまく見えます。投稿ウェブサイトで定義されていない定数を使用
が、私は、私はページを更新するときに、それの主な問題があるページに
を更新しようとすると、それはまだそれがこの
お知らせのようなものを示して
、問題を示しています。未定義のインデックス: /Applications/XAMPP/xamppfiles/htdocs/cms/admin/includes/edit_post.phpの画像が
31行に関するお知らせ:Undefin ED指数: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
ので、ライン上の /Applications/XAMPP/xamppfiles/htdocs/cms/admin/includes/edit_post.php の画像、イムかなり確信して私はそれらのクエリにいくつかの構文の問題を抱えていますおそらく、私はいくつかの行にいくつかのスペースを追加することを忘れていますか?
私は関数confirm()がうまくいると信じています、それは単なる関数名です。
$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));
これは、画像形式、グループhtmlコード
である私は、彼らが試合らしい名前=「post_image」をチェックしました。
他の質問をチェックしましたが、なぜここに通知があるのか理解できません。
$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>