2016-06-17 27 views

回答

3

它的數據庫名稱

mysqli_connect(host,username,password,dbname,port,socket); 

Parameter  Description 
host   Optional. Specifies a host name or an IP address 
username  Optional. Specifies the MySQL username 
password  Optional. Specifies the MySQL password 
dbname   Optional. Specifies the default database to be used 
port   Optional. Specifies the port number to attempt to connect to the MySQL server 
socket   Optional. Specifies the socket or named pipe to be used 

來源:http://php.net/manual/en/function.mysqli-connect.php

+0

謝謝你的回答。 – sanzuu

1

在你的榜樣,forks是第四個參數,所以它只是數據庫的名稱。單詞forks在MySQL中沒有任何意義,並且與代碼本身沒有任何關聯。

mysqli_connect() PHP函數的參數如下:

  1. 主機
  2. 用戶名
  3. 密碼
  4. 數據庫名稱
  5. 端口
  6. 插槽

請參閱PHP手冊中的mysqli::__construct()函數,其中mysqli_connect是別名。

+0

感謝您的有用答案。 – sanzuu

+0

不客氣。如果您覺得這個答案對您有幫助,請考慮同時答覆答案,並將其標記爲已接受。 –

相關問題