Author Archives: admin

Eloquent to access another DB

Reference:

  1. https://stackoverflow.com/questions/31847054/how-to-use-multiple-databases-in-laravel

Join in CodeIgniter

 

Calculate DB sizes of Mysql on Linux

 

Ajax Example

 

Get table column names in laravel

Add this function in eloquent model:

 

Get JSON data from request

 

Calculate string length by bytes

“中文”.length in javascript will return 2 which is not the result I want, here is the replacement:

byteLength(‘中文’); will return 6.

Reference:

FTP in IIS 10

Notes:

  1. 如果要設定虛擬目錄,從FTP根目錄指到別的資料夾,虛擬目錄的名稱要和實際資料夾的名稱一模一樣
  2. 所有目錄都要設定權限給FTP user