0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

20250903_AP_エスケープとプレースホルダの違い

0
Posted at

エスケープとプレースホルダは、どちらもSQLインジェクション対策の手段だが、対策方針、実装等が異なる。

エスケープ

入力文字列に含まれる特殊文字列を文法を壊さない形にしてから、クエリに組み込む。
アプリ側に処理として組み込む。
実装漏れが発生する可能性がある。

プレースホルダ

入力文字列全体を値としてクエリに組み込む。
DBドライバ、または、DBエンジンが実行する。
データ更新時、DB側でもれなく対応するため安全。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?