php - adding hebrew value to sql using PDO -
i trying add hebrew value database using php's pdo class.
after succeeding doing (by using: array(pdo::mysql_attr_init_command => "set names utf8"
), found out collate hebrew_ci_as
added value.
is there way prevent addition?
thank you, , sorry bad english.
php: right way source of information on this.
basically check whether pdo-connection specifies charset in dsn:
new pdo( 'mysql:host=your-hostname;dbname=your-db;charset=utf8', 'your-username', 'your-password', array( # ... pdo connection options ) );
make sure database tables set use utf8-collation, either phpmyadmin or using mysql-command line utility , following query:
alter table table_name collate utf8;
also might want consider using utf8mb4 suggested in book.
Comments
Post a Comment