0

I have a problem with my Zend installation.

It trims special characters (with accents) and simple quotes off before sending my to the my Database (MySQL)

In my bootstrap.ini, it's set to use UTF-8

   `$dbAdapter->query("SET NAMES 'utf8'");` 

Is there a special treatment to apply to my form elements before sending it to my database table ?

Thanks

Stéphane Joos
  • 743
  • 1
  • 6
  • 13
  • This is most probably due to some anti-[SQL injection](https://en.wikipedia.org/wiki/SQL_injection) mechanism that is probably a default setting for Zend. – cobarzan Aug 05 '15 at 16:42
  • I solved the problem of accents but still impossible to insert simple quotes. What is weird is that the orror occurs only on text fields and not on textareaq – Stéphane Joos Aug 05 '15 at 17:12
  • Do you mean accented characters are not inserted, converted to something else, or does the string break at the first accented char? Can you see the correct data in your database if you view with phpmyadmin or another tool? There is nothing built into ZF that would do this so we need more info. – Tim Fountain Aug 05 '15 at 19:58
  • @TimFountain Sorry for the late answer : It breaks the string at the first accented character and when i look into my database table, it breaks also at the first accented character – Stéphane Joos Aug 12 '15 at 16:20
  • Her's the error messgae thrown : Message: SQLSTATE[HY093]: Invalid parameter number: no parameters were bound, query was: select * from questions where question='Donquishirt c'est quoi ?' and ques_id!='1' – Stéphane Joos Aug 13 '15 at 17:00

0 Answers0