php - SQLState error when binding parameters -


Today I received an unusual response when trying to do some inquiries, here is the error output.

  [17-Feb-2014 12:37:24 America / Denver] PPO WARNING: PDOSTATMENT :: EXPAND (): SQLSTATE [42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax;  

To use the near 'key =' AH3D 'in line 1 on the file is the manual for the correct syntax that checks the code you are using. In this way I have always done this.

  get public function ($ key = null) {$ get = $ this- & gt; Conn- & gt; ("SELECT url FROM url WHERE key =: get"); $ Get-> Execute (array (': get' = & gt; $ key)); Return $ get- & gt; Bring (); }  

How do I call a function.

  echo per dollar-> ($ _ GET ['key']);  

key is a mysql reserved keyword that you use Want back-tex your column name key

  $ get = $ this- & gt; Conn- & gt; Prepare ("URL Select URL From URL" =: Received ");  


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -