teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

ご指摘の変数ミス修正しました。

2018/09/08 00:54

投稿

toritoritori
toritoritori

スコア16

title CHANGED
File without changes
body CHANGED
@@ -33,7 +33,7 @@
33
33
  $stmt->bindParam(1,$text1,PDO::PARAM_STR);
34
34
  $stmt->bindParam(2,$text2,PDO::PARAM_STR);
35
35
  $stmt->bindParam(3,$text3,PDO::PARAM_STR);
36
- $stmt->bindParam(4,$text4,PDO::PARAM_STR);
36
+ $stmt->bindParam(4,$base64_iv,PDO::PARAM_STR);
37
37
  $stmt->execute();
38
38
  ```
39
39
  次に、別のファイルで、データベースに保存したテキストを取り出し、復号化しようとしました。

1

テーブル名の誤字修正

2018/09/08 00:54

投稿

toritoritori
toritoritori

スコア16

title CHANGED
File without changes
body CHANGED
@@ -28,7 +28,7 @@
28
28
  $base64_iv=base64_encode($iv);
29
29
 
30
30
  //データベースに挿入
31
- $sql='INSERT INTO tablename(text1,text2,text3,iv) VALUES(?,?,?,?)';
31
+ $sql='INSERT INTO table1(text1,text2,text3,iv) VALUES(?,?,?,?)';
32
32
  $stmt=$dbh->prepare($sql);
33
33
  $stmt->bindParam(1,$text1,PDO::PARAM_STR);
34
34
  $stmt->bindParam(2,$text2,PDO::PARAM_STR);