Jump to content

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

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.