Home > PHP Framework > YII > body text

How to add prefix to table in yii2

藏色散人
Release: 2020-07-21 12:01:33
Original
2848 people have browsed it

yii2 Method to prefix the table: First find and open the database configuration related files; then set the table prefix through the statement "'tablePrefix'=>'colin_'", which means that the table prefix has been set to "colin_".

How to add prefix to table in yii2

yii2 Add table prefix

config /web >$config >components>db>['tablePrefix'=>'colin_']
Copy after login
  • The table prefix here is colin_.

  • If you want to access table colin_86, you can directly use {{�}} to automatically add the prefix.

Recommended: "yii tutorial"

The above is the detailed content of How to add prefix to table in yii2. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!