News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Nessa's Blog:
Convert Database to UTF-8
December 13, 2007 @ 10:23:00

Nessa has posted a quick way to convert a database from whatever character set it's currently on over to UTF-8 with a handy PHP script.

When you're dealing with special characters in a database, you have to make sure that the charset and collation are dumped *with* the database, so that when you move it to another server the tables and data create properly. The biggest annoyance so far is converting tables back to UTF-8, as when this is done through the MySQL shell or phpmyadmin is had to be done table-by-table.

The script logs into the database and pulls all of the table information out (could be a lengthy list depending on the database) and runs an ALTER TABLE to change its character set to 'UTF8'.

0 comments voice your opinion now!
characterset utf8 convert alter database table characterset utf8 convert alter database table


blog comments powered by Disqus

Similar Posts

DevShed: The Active Record Pattern, Concluded

DevShed: Introduction to Using SQLite with PHP 5

Zend Developer Zone: Build an Enterprise-Grade PHP Stack with Zend Server 5.0 and Oracle 11g

Community News: Ottawa Food Bank Improve Distribution Databases via PHP

Rob Allen's Blog: One-to-Many Joins with Zend_Db_Table_Select


Community Events

Don't see your event here?
Let us know!


opinion series framework api php7 voicesoftheelephpant community performance symfony2 application release interview laravel configure introduction podcast language part2 conference example

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework