發表文章

Markdown

[mysql] ORDER BY

http://www.1keydata.com/tw/sql/sqlorderby.html ORDER BY: SELECT "欄位名" FROM "表格名" [WHERE "條件"] ORDER BY "欄位名" [ASC, DESC]; [] 代表 WHERE 子句不是一定需要的。 不過,如果 WHERE 子句存在的話,它是在 ORDER BY 子句之前。 ASC 代表結果會以由小往大的順序列出,而 DESC 代表結果會以由大往小的順序列出。 如果兩者皆沒有被寫出的話,那我們就會用 ASC。

[mysql] dtrict mode

1 # For advice on how to change settings please see 2 # http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html 3 4 [mysqld] 5 sql_mode = "STRICT_TRANS_TABLES" 6 7 # 8 # Remove leading # and set to the amount of RAM for the most important data 9 # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. 10 # innodb_buffer_pool_size = 128M 11 # 12 # Remove leading # to turn on a very important data integrity option: logging 13 # changes to the binary log between backups. 14 # log_bin 15 # 16 # Remove leading # to set options mainly useful for reporting servers. 17 # The server defaults are faster for transactions and fast SELECTs. 18 # Adjust sizes as needed, experiment to find the optimal values. 19 # join_buffer_size = 128M 20 # sort_buffer_size = 2M 21 # read_rnd...

[git] 專案練習

[eric_tu@localhost ~]$ git clone ssh://eric_tu@192.168.30.58/home/git/git/eric_tu.git Cloning into 'eric_tu'... remote: Counting objects: 3, done. remote: Total 3 (delta 0), reused 0 (delta 0) Receiving objects: 100% (3/3), done. [eric_tu@localhost ~]$ ll 總計 8 -rw-r--r--. 1 eric_tu eric_tu 176 5月 2 22:11 bashrc drwxrwxr-x. 3 eric_tu eric_tu 25 5月 9 01:38 eric_tu drwxr-xr-x. 2 root root 31 5月 2 20:05 linux_basic -rw-r--r--. 1 root root 3996 5月 9 01:15 ssh_backup [eric_tu@localhost ~]$ cd eric_tu/ [eric_tu@localhost eric_tu]$ ll 總計 0 -rw-rw-r--. 1 eric_tu eric_tu 0 5月 9 01:38 1 [eric_tu@localhost eric_tu]$ gl * 07990e9 (HEAD, origin/master, origin/HEAD, master) initial commit [eric_tu@localhost eric_tu]$ alias alias egrep='egrep --color=auto' alias fgrep='fgrep --color=auto' alias gc='git checkout' alias gl='git log --oneline --decorate --graph --color' alias grep='grep --color=auto' alias gs='git status...

[symfony] set form required in fromBuilder

http://symfony.com/doc/current/reference/forms/types/form.html#empty-data 當 required 設定為 true 的時候 會去呼叫 HTML5 的檢查API empty_data¶ type: mixed The actual default value of this option depends on other field options: If data_class is set and required is true, then new $data_class(); If data_class is set and required is false, then null; If data_class is not set and compound is true, then array() (empty array); If data_class is not set and compound is false, then '' (empty string). This option determines what value the field will return when the submitted value is empty (or missing). It does not set an initial value if none is provided when the form is rendered in a view. This means it helps you handling form submission with blank fields. For example, if you want the name field to be explicitly set to John Doe when no value is selected, you can do it like this: $builder->add('name', null, array( 'required' => false, ...

[symfony] 常用指令

bin/console doctrine:cache:clear-metadata bin/console doctrine:cache:clear-query bin/console doctrine:cache:clear-result php bin/console cache:clear --env=prod or php bin/console cache:clear -e prod