PHP-MySQL-Class
PHP-MySQL-Class copied to clipboard
Please add connect port
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);
This is already done, the var $this->hostname
is constructed with the Port $this->hostname = $hostname.':'.$port;
.