1
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?

More than 5 years have passed since last update.

MYSQLのエラー関連のエラーってわかりにくいよね

Posted at

エラー発生:SQLSTATE[HY093]

Invalid parameter number: number of bound variables does not match number of tokens

例外処理時のExceptionにてキャッチした際に発生したエラー。

catch(Exception $e){
debug('エラー発生:'.$e->getMessage());
}

debug()関数でエラー文をエラー時に別ファイルに作成

##エラーの考えられる原因
1.SQL文のミス
主にINSERT INTOの対象となるパラメーター以外の記述はしてはいけない(と思う)
対象プレースホルダーに注意。

1
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
1
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?