How to insert an hebrew value into a mysql db in php

后端 未结 8 1165
温柔的废话
温柔的废话 2020-12-10 15:30

I\'m trying to insert an hebrew value into my mysql db, instead of hebrew the values looks like that.

שדגשדכעשד

8条回答
  •  一生所求
    2020-12-10 16:11

    I would say, in order to make sure that the values are passed well to the database I would add a die statment before inserting to the database and print the value, example:

    die($_POST['thevalue']);
    //insert to database.
    //...
    

    If it goes well, then the problem is on the database side, on the database I would try with this collation

    | hebrew | ISO 8859-8 Hebrew | hebrew_general_ci | 1 |

    as per http://dev.mysql.com/doc/refman/5.0/en/charset-mysql.html suggest.

    But if it fail on the php side, reason can be, the server does not support Hebrew, make sure that on the html output document you use the correct metatag with

    ...
    
    ...
    

    Let us knows how it proceed, good luck :)

提交回复
热议问题