Hello. I have three files: one called sql.php witch has a class db that I use to ease the get results operation from MySQL; one called session.class.php that has class session (extending class db) witch I use to make my basic operations as functions... like check_login function witch I use to check if user is logged in; and another one called main.class.php that I have from a login module posted on a forum. At first it used another file as MySQL wrapper called mysql.class.php that I didn't like and replaced it with my sql.php. Now, I get an error in my main.class.php file like this:
"Warning: Missing argument 2 for db::db(), called in C:\wamp\www\extlogin\inc\main.class.php on
line 14 and defined in C:\wamp\www\extlogin\inc\sql.php on line 33
Warning: Missing argument 3 for db::db(), called in C:\wamp\www\extlogin\inc\main.class.php on
line 14 and defined in C:\wamp\www\extlogin\inc\sql.php on line 33
Warning: Missing argument 4 for db::db(), called in C:\wamp\www\extlogin\inc\main.class.php on
line 14 and defined in C:\wamp\www\extlogin\inc\sql.php on line 33"
My main.class.php file looks like this:
<?php
require_once("sql.php");
require_once("session.class.php");
class main extends db {
public function __construct() {
header('Content-Type: text/html; charset=iso-8859-1');
session_start();
if (class_exists('db')) {
} else {
die("Database class does not exist!");
}
if (class_exists('session')) {
$this->session = new session($this);
} else {
die("Session class does not exist!");
}
}
}
?>
Where line 14 in my main.class.php file has this: $this->session = new session($this);
and line 33 in my sql.php file has the function db for connection defined like this:
function db($dbuser, $dbpassword, $dbname, $dbhost)
Can anybody tell my how to fix this error ? I could give you more details if you need them.
Thanks.