How can retrieve Special Characters from a database table

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vcodeinfotec
Forum Newbie
Posts: 10
Joined: Sat Jul 12, 2008 2:08 am

How can retrieve Special Characters from a database table

Post by vcodeinfotec »

Hello...

I am trying to retrieve records from a MYSql table. And i want to update that record. when i retrieving records it shows the characters like � ? instead of ’ — “. How can insert and retrieve special characters like these?

Please help on this topic...
Amit Rathi
Forum Newbie
Posts: 7
Joined: Fri Jul 25, 2008 6:17 am
Location: India

Re: How can retrieve Special Characters from a database table

Post by Amit Rathi »

CONVERT() provides a way to convert data between different character sets

Visit : http://dev.mysql.com/doc/refman/5.0/en/ ... nvert.html
manixrock
Forum Commoner
Posts: 45
Joined: Sun Jul 20, 2008 6:38 pm

Re: How can retrieve Special Characters from a database table

Post by manixrock »

Usually the best way is to always work with UTF-8 encoding. Simply call this after you connect to the database (it sets the default encoding). Also make sure the text encodings in the database are all set to utf-8.

Code: Select all

mysql_query('SET NAMES utf8');
Post Reply