search

Home  >  Q&A  >  body text

Replacing header fields when querying data with PHP MySQL does not support Chinese

Writing like this doesn’t work

field(['id'=>'Number','name'=>'Name','url'=>'Website'])

You can write it like this

->field(['id'=>'m','name'=>'n','url'=>'u' ])

The SQL statement is like this

SELECT `id` AS `m`,`name` AS `n`,`url` AS `u` FROM `websites` WHERE `id` = 4 LIMIT 1屏幕快照 2019-04-07 下午11.56.40.png

屏幕快照 2019-04-07 下午11.55.30.png

去如烟去如烟2092 days ago1300

reply all(3)I'll reply

  • 天蓬老师

    天蓬老师2019-04-08 22:00:29

    After ThinKPHP5.1.20, the use of Chinese aliases is no longer supported, please pay attention

    reply
    0
  • 去如烟

    Thanks

    去如烟 · 2019-04-09 00:42:05
  • Cancelreply