Help, need a little help!!! |
|
Well I've started to play about with PHP and I'm quiet ashamed to say that I'm already stuck
I don't seem to be able to call a function from a constructor for some reason.
I want to do something like this:
php: |
class User
{
function User($fName, $lName, $email)
{
if( userExists($fName, $lName, $email) )
{
//user already exists
}
else...
}
function userExists($fName, lName, $email)
{
//check for user
return bool;
}
}
|
|
and from another page I do the following
$user = new User('Jimbo', 'Jones', '[email protected]');
but I'm getting an error like so:
Fatal error: Call to undefined function: userExists()
Why cant i call a function from a constructor?
verum ipsum factum
|