Jump to content

mysql classes, user systems, errors, include files.


fantomel

Recommended Posts

Hello i have a small problem with a mysql class and i can't get it fixed.

 

 

These are the errors :

Warning: Missing argument 1 for MySQL::__construct(), called in C:\webserver\public_html\core\core.php on line 9 and defined in C:\webserver\public_html\classes\mysql.class.php on line 11

Warning: Missing argument 2 for MySQL::__construct(), called in C:\webserver\public_html\core\core.php on line 9 and defined in C:\webserver\public_html\classes\mysql.class.php on line 11

Warning: Missing argument 3 for MySQL::__construct(), called in C:\webserver\public_html\core\core.php on line 9 and defined in C:\webserver\public_html\classes\mysql.class.php on line 11

Warning: Missing argument 4 for MySQL::__construct(), called in C:\webserver\public_html\core\core.php on line 9 and defined in C:\webserver\public_html\classes\mysql.class.php on line 11

Fatal error: Class 'Inter_error' not found in C:\webserver\public_html\classes\mysql.class.php on line 20

 

my core.php php code:

 

<?php
require '../classes/mysql.class.php';
global $db;
$db = &new MySQL(localhost, root, root, testing); 
?>

 

my mysql class :

 

class MySQL
{
var $host;
var $name;
var $pass;
var $dba;
var $resultLink;
private $connection;

public function __construct($host, $name, $pass, $dba)
{
	if($host && $name && $pass & $dba) {
		if(!$this->connection = mysql_connect($host,$name,$pass))
		throw new MySQL_error("Database Connection Failed!");

		if(!mysql_select_db($dba, $this->connection))
		throw new MySQL_error("Database Can't Be Selected");
	} else {
		throw new Inter_error("Method: __construct--Error:Incorect arg(requires \$host, \$name, \$pass, \$dba)!!!!");
	}
}
?>

 

in mysql i have added only the part where it gives the errors.

Please can someone help me ?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.