Yii v2 snippet guide

Comparing #13 with #14

Revision #14 was created by rackycz rackycz on Sep 19, 2019, 9:00:55 PM.

db

Content

[...]
---
To create DB with users, use following command. I recommend charset **utf8_unicode_ci** (or utf8mb4_unicode_ci) as it allows you to use [more international characters](https://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci).

```MySQL
CREATE DATABASE IF NOT EXISTS `yii-demo-db` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
```
 
 
If you must use MyISAM instead of InnoDB, just skip the last row.
 
 
```MySQL

CREATE TABLE IF NOT EXISTS `user` (
`id` INT NOT NULL AUTO_INCREMENT,
[...]
PRIMARY KEY (`id`))
ENGINE = InnoDB;
```
 
 
Adding first user:
 
 
```MySQL
INSERT INTO `user` (`id`, `username`, `password`) VALUES (NULL, 'user01', '0497fe4d674fe37194a6fcb08913e596ef6a307f'); ``` If you must use MyISAM instead of InnoDB, just change the word InnoDB into MYISAM.
 
 
Login via database + Session
---
... text ...

Access rights
---
[...]