什麼是MySQL的 「叉」mysqli_connect()中的第四個參數是什麼?
<?php
$connect = mysqli_connect("db location","username","password", "forks") or die(mysql_error());
?>
什麼是MySQL的 「叉」mysqli_connect()中的第四個參數是什麼?
<?php
$connect = mysqli_connect("db location","username","password", "forks") or die(mysql_error());
?>
它的數據庫名稱
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
謝謝你的回答。 – sanzuu
在你的榜樣,forks
是第四個參數,所以它只是數據庫的名稱。單詞forks
在MySQL中沒有任何意義,並且與代碼本身沒有任何關聯。
的mysqli_connect()
PHP函數的參數如下:
請參閱PHP手冊中的mysqli::__construct()函數,其中mysqli_connect是別名。
感謝您的有用答案。 – sanzuu
不客氣。如果您覺得這個答案對您有幫助,請考慮同時答覆答案,並將其標記爲已接受。 –
@Warren Sergent - spakatak.com:感謝您的編輯。 – sanzuu