Jump to content

mysql classes, user systems, errors, include files.


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 ?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.