Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class makeConnection(){
- private $serverName;
- private $schemaName;
- private $userName;
- private $password;
- public $mysqlResouce;
- function setConnectionParameters($s, $u, $p, $s){
- $this->serverName = $s;
- $this->userName = $u;
- $this->password = $p;
- $this->schemaName = $s;
- }
- function makeConnection(){
- if (false === ($this-> mysqlResouce = mysql_connect($this->serverName, $this->userName, $this->password)));
- return '0';
- if (false === mysql_select_db($this->schemaName);)
- return '0';
- return $this-> mysqlResource;
- }
- function destroyConnection(){
- if (true === mysql_close($this->mysqlResource))
- return '1';
- else
- return '0';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement