PHP/MySQL encoding problems. � instead of certain characters

后端 未结 6 2032
孤街浪徒
孤街浪徒 2021-01-07 01:00

I have come across some problems when inputting certain characters into my mysql database using php. What I am doing is submitting user inputted text to a database. I cannot

6条回答
  •  再見小時候
    2021-01-07 01:22

    Get rid of everything you just need to follow these two points, every problem regarding special languages characters will be resolved.

    1- You need to define the collation of your table to be utf8_general_ci.

    2- define in the HTML after head tag.

    2- You need to define the mysql_set_charset('utf8',$link_identifier); in the file where you made connection with the database and right after the selection of database like 'mysql_select_db' use this 'mysql_set_charset' this will allow you to add and retrieve data properly in what ever the language it is.

提交回复
热议问题