PHP-MySQL-Class icon indicating copy to clipboard operation
PHP-MySQL-Class copied to clipboard

Please add connect port

Open panaceya opened this issue 10 years ago • 1 comments

38c38
< 

---
>       var $port;      // MySQL Port or path to local UNIX socket 
42d41
< 
47c46
<       function MySQL($database, $username, $password, $hostname='localhost'){

---
>       function MySQL($database, $username, $password, $hostname='localhost', $port = 3306){
52c51
< 

---
>               $this->port     = $port;
68c67
<                       $this->databaseLink = mysql_pconnect($this->hostname, $this->username, $this->password);

---
>                       $this->databaseLink = mysql_pconnect("{$this->hostname}:{$this->port}", $this->username, $this->password);
70c69
<                       $this->databaseLink = mysql_connect($this->hostname, $this->username, $this->password);

---
>                       $this->databaseLink = mysql_connect("{$this->hostname}:{$this->port}", $this->username, $this->password);

panaceya avatar Nov 27 '13 09:11 panaceya

This is already done, the var $this->hostname is constructed with the Port $this->hostname = $hostname.':'.$port;.

Gummibeer avatar Apr 15 '14 10:04 Gummibeer