Sto eseguendo la query insert
da uno script di shell che legge i dati da più file. Alcuni dei dati da inserire contiene '
nel testo e MySQL continua a dare erroriCome inserire un carattere speciale come 'in MySQL?
ERROR 1064 (42000) at line 1: 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 's Development & Empowerment, Youth Affairs
','
Himachal Pradesh ' at line 1
Questo è il testo vero e proprio: Women's Development & Empowerment, Youth Affairs
.
questa discussione può aiutare: [MYSQL Escaping righe di comando tramite Bash Scripting] (http://stackoverflow.com/questions/4383135/escaping-mysql-command-lines-via-bash-scripting) – jujule
E 'meglio se sfugga' carattere con 'che \. È perché alcuni db ex: sqllite mostrano un errore con il carattere \ escape. Puoi scrivere: "Sviluppo e responsabilizzazione delle donne, affari giovanili". – YROjha