note 41838 rejected from function.mysql-connect by betz
| From: | betz@php.net | Date: | Fri, 23 Apr 2004 12:52:27 +0000 |
| Subject: | note 41838 rejected from function.mysql-connect by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-68662@lists.php.net to get a copy of this message | ||
Note Submitter: eric@manas.kg
----
You wrote this at
http://my.php.net/manual/en/function.mysql-connect.php
****************************
<?php
class DB {
function DB() {
$this->host = "mysql.host.com";
$this->db = "myDatabase";
$this->user = "root";
$this->pass = "mysql";
$this->link = mysql_connect($this->host, $this->user, $this->pass);
mysql_select_db($this->db);
}
}
?>
And then, on each of your pages, include the file with your database class, and then...
<?php
$DB = new DB;
?>
********************************
what will if i will use another database? i'm new to this. thanks.