note 102296 added to language.oop5.basic
| From: | said9923 at gmail dot com | Date: | Mon, 07 Feb 2011 14:20:28 +0000 |
| Subject: | note 102296 added to language.oop5.basic | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-176737@lists.php.net to get a copy of this message | ||
class dbConnect{
public $host = "localhost";
public $user;
private $pwd;
protected $name;
function dbConnect($dbHost, $dbUser, $dbPwd, $dbName)
{
$this->host = $dbHost;
$this->user = $dbUser;
$this->pwd = $dbPwd;
$this->name = $dbName;
}// Class Constructor Function
function Connect(){
$con = mysql_connect($this->host, $this->user, $this->pwd);
if($con)
{
mysql_select_db($this->name) or die(mysql_error());
}
return $con;
}
}
//Define variables required for database connection
$host = "localhost";
$user = "said";
$pwd = "";
$name = "";
//Instance of the dbConnect class
$Connect = new dbConnect($host, $user, $pwd, $name);
$Connect -> Connect();
----
Server IP: 69.147.83.197
Probable Submitter: 41.59.0.157
----
Manual Page -- http://www.php.net/manual/en/language.oop5.basic.php
Edit -- https://master.php.net/note/edit/102296
Del: integrated -- https://master.php.net/note/delete/102296/integrated
Del: useless -- https://master.php.net/note/delete/102296/useless
Del: bad code -- https://master.php.net/note/delete/102296/bad+code
Del: spam -- https://master.php.net/note/delete/102296/spam
Del: non-english -- https://master.php.net/note/delete/102296/non-english
Del: in docs -- https://master.php.net/note/delete/102296/in+docs
Del: other reasons-- https://master.php.net/note/delete/102296
Reject -- https://master.php.net/note/reject/102296
Search -- https://master.php.net/manage/user-notes.php