Unsupported data expression: name
星星蓝蓝
星星蓝蓝 2018-12-04 18:16:58
0
3
1800

Follow the video method: -> field(['name' => "name", 'salary'] )

will prompt an unsupported data expression. If you change "name" There is no problem if you change it into English or use "field('name as name, salary')".


#May I ask what the reason is?


星星蓝蓝
星星蓝蓝

reply all(1)
Peter-Zhu

You can set the alias directly using a string

  • reply Well, there is no problem with the string, but there is a problem with the array mode setting. After looking at it, it seems to be a problem with the framework source code. The regular expression only filters English characters. Later put the framework in library/think/db/build/Mysql.php This line in: if ($strict && !preg_match('/^[\w\.\*]+$/', $key)) { Changed to: if ($strict && !preg_match('/^[\x{4e00}-\x{9fa5}\w\.\*]+$/u', $key)) { That's it.
    星星蓝蓝 author 2018-12-07 16:16:44
  • reply But in your video tutorial, there is no problem if you use arrays directly. I don’t know how you set it up :)
    星星蓝蓝 author 2018-12-07 16:17:50
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template