0

I have an issue and I've wasted enough time on it already.

I'm writing the name of the files in a directory into my database, but some files have special characters in them, like accents, and I keep getting this error when I try to write.

SQLSTATE[ HY000 ]: General error: 1366 Incorrect string value.

I've already tried changing the charset of my database and its tables but it's still the same.

Thank you for your help.

Regolith
  • 2,944
  • 9
  • 33
  • 50
litaned
  • 59
  • 1
  • 7
  • check [this](https://stackoverflow.com/questions/27828910/php-error-description-incorrect-string-value-xf4t-l-xe9-on-insert). probably character encoding is wrong – Regolith Jul 16 '17 at 07:50
  • Wow Regolith I wish I would've made this question before! Your suggestion really helped me so much. All I had to do is to encode my variable like : $ value=utf_encode ($value). Thank you so much! – litaned Jul 16 '17 at 13:07
  • What encoding is in your application? Check the "best practice" in http://stackoverflow.com/questions/38363566/trouble-with-utf8-characters-what-i-see-is-not-what-i-stored . If that does not help enough, then provide info on the things that it mentions. – Rick James Jul 17 '17 at 06:13

0 Answers0