A
A
Alexey Prikazchikov2016-08-17 12:18:06
PHP
Alexey Prikazchikov, 2016-08-17 12:18:06

Phalcon and MySQL. Why does the encoding behave strangely?

Good day.
There is a small project on Phalcon. Testing on OpenServer.
There is a problem with the encoding at the time of transfer to the public. All text fields displays questions.
But at the same time, in the database itself + if I add an entry directly through the script on the site, and not in PHPMySQLAdmin,
then all previously exported entries are questions, and the new entry is displayed normally. Yes, and if I edit the records already through the site, then they are displayed as they should.
Encodings everywhere rechecked 100 times. Comparisons too. Everything is the same everywhere. Where is the nail?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Алексей Приказчиков, 2016-08-17
@alexprik07 Автор вопроса

'database' => array(
'adapter' => 'Mysql',
'host' => 'localhost',
'username' => '',
'password' => '',
'dbname' => '',
' charset' => 'utf8',
'options' => array(
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8 '
)
)
Maybe someone will come in handy. Not yet added:
'options' => array(
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8 '
)

T
toxa82, 2016-08-17
@toxa82

Вот где-то в момент переноса вы не выставляете кодировку.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question