I feel really stupid. I'm trying to use OOP for the first time and design a class that handles database functions. I started off with this code and for some reason it won't work.
<?
class mysql {
var $host;
var $database;
var $username;
var $password;
function mysql()
{
mysql_connect($this->host, $this->username, $this->password)
or die("<b>Could not connect to MySQL server:</b><br>" . mysql_error());
mysql_select_db($this->db)
or die("<b>Could not select MySQL database:</b><br>" . mysql_error();
return;
}
}
?>
Any Ideas?