Jump to content

[SOLVED] help new to oop


Stickybomb

Recommended Posts

hi i am working on my first really project using oop in php and have come across an error i do not under stand

Fatal error: Call to a member function insertUser() on a non-object in /home/sticky/public_html/cms/inc/security.php on line 204

this is the function it is refernceing

[code=php]
function insertUser($user,$pass,$email,$sid,$time) {
$sql = 'INSERT INTO users (user_pass, user_name, user_lvl, user_email, user_timestamp, user_sid, user_ip) VALUES ("'.$pass.'","'.addslashes($name).'","1",,"'.addslashes($email).'","'.$time.'","'.$sid.'","'.$_SERVER['REMOTE_ADDR'].'")';
$db->query($sql);
}

//add user

function addUser() {

$email = $this->value['email'];

$sid = $this->value['sid'];

$pass = $this->value['pass'];

$user = $this->value['user'];

$time = Security::generateTimestamp();

$q->insertUser($user,$pass,$email,$sid,$time);  //<-----This is the line from the error

switch(VALIDATION_METHOD) {

case 0:

$this->generateEmail();

break;

 

case 1:

$this->generateValidEmail();

break;

 

case 2:

$this->generateAdminValidEmail();

break;

}

 

}

[/code]

 

any help pls?

Link to comment
https://forums.phpfreaks.com/topic/72361-solved-help-new-to-oop/
Share on other sites

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.