note 107554 deleted from function.mysql-connect by tularis
| From: | tularis@php.net | Date: | Sat, 18 Feb 2012 13:25:48 +0000 |
| Subject: | note 107554 deleted from function.mysql-connect by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-186210@lists.php.net to get a copy of this message | ||
Note Submitter: pvviswanathanpv at gamil dot com
----
simple connection object
using server ip address and mysql port
<?php
class connection
{
public $link;
public $host;
function __construct()
{
$ip=$_SERVER['SERVER_ADDR'];
$port=":3306";
$this->host="$ip$port";
}
function __destruct()
{
}
function start()
{
$this->link=mysql_connect($this->host,"viswa","feather");
mysql_select_db("commun",$this->link);
}
function stop()
{
mysql_close($this->link);
}
};
$database= new connection();
?>