Mi Lugarcito

MySql - SQL syntax error 본문

MySql

MySql - SQL syntax error

selene park 2021. 12. 8. 16:20

You have an error in your SQL syntax; check the manual that corresponds to your MYSQL server version for the right syntax to use near... 에러

https://henerd.tistory.com/24

 

[SQL 에러] You have an error in your SQL syntax; check the manual that corresponds to your MYSQL server version for the right

You have an error in your SQL syntax; check the manual thatcorresponds to your MYSQL server version for the right syntax to use near '블라블라' 이것은 무슨 에러일까? [너으 문법이 틀렸다.] 라는 뜻이..

henerd.tistory.com

 

 

 

object를 db에 저장해야 할때 syntax error 해결방법 : query 문에서 아래와 같이 back tick 이 아니라

`update studio_contents set title=?,imgs=?,made_type=?,w_size=?,h_size=? where idx=? and user_id=?`
        `

 

아래와 같이 ""로 쿼리구문 써주면 됨

await con.promise().query("update studio_contents_data set `data`=? where c_idx=?",[JSON.stringify(data),idx]);