Wrox Programmer Forums
|
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 28th, 2012, 08:38 AM
Authorized User
 
Join Date: Dec 2004
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default Character code

Hi,

I have records in my MySQL database which are in Romanian, where such characters as ă, î, â, ș, ț appear. The database was created with the statement

Code:
CREATE DATABASE <db_name> DEFAULT CHARACTER SET utf8 COLLATE utf8_romanian_ci;
and, as you'd expect, there's no problem with the Romanian characters (e.g. in the MySQL utility).
However, in PHP generated HTML, I get rogue characters instead of the correct ones after a SELECT... query.

What can I do to get correct characters ?

On the Internet, someone suggested to have a "SET CHARACTER SET utf8;" directive before the query.
Well, it seemed to work for some queries (or the first in a row), but I still get rogue chars in a PHP script where I have multiple subsequent queries.


Thanks,

Mike





Similar Threads
Thread Thread Starter Forum Replies Last Post
Get Ascii code for a character in XSLT mswin XSLT 8 November 28th, 2008 08:21 AM
how do I convert character to utf hex code? mondayisgreat Classic ASP Basics 1 January 24th, 2008 01:48 PM
character entity into numeric character entity srkumar XSLT 1 November 22nd, 2007 04:53 AM
How to convert UTF8 code to character ghostnguyen C# 1 July 18th, 2005 05:28 AM
Decimal code for a special character mcinar HTML Code Clinic 14 February 4th, 2005 01:56 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.