Help us understand the problem. What is going on with this article?

ボタンを押した時に処理を実行させたい時

今回は投稿内容を編集し、編集完了ボタンを押したらdbの投稿内容を書き換える(更新する)というもの

if文で条件を指定してからデータベースへアクセスし書き換えるという流れ

<?php
/ post_rewriteはinputタグのname属性/

if(isset($POST['post_rewrite'])){
$statement = $db->prepare('UPDATE posts SET message=? WHERE id=?');
$statement->execute(array($
SESSION['message'],$SESSION['postsid']));
?>

HTML文(ボタンの部分のみ)

これで修正完了するボタンを押すとphpが処理される

takahiro0216
未経験からエンジニア転職を考え、独学中です。日々の学習内容の忘備録
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした