This question already has an answer here:
I'm currently working on a application which pulls JSON from a database and then adds a new user to the array and returns it as JSON. When I tried running my addFriend() function I got the "Call to undefined function userExists()" error. I can't seem to figure out why.
public function userExists($user = null){
if(is_numeric($user)){
$test = $this->_db->get('members', array('ID', '=', $user));
if($test->count()) {
return true;
}
}
return false;
}
public function addFriend($friend){
if(is_numeric($friend)){
if( userExists($friend) ){
if(hasFriends()){
$friendsList = getFriends();
$friendsList[] = $friend;
}else{
$friendsList = array($friend);
}
}
}
return false;
}
I am using a PDO class I made to call the queries and make the connection, which seems to be working fine. count()
just returns the rowCount()
.
I know it's going to be something small I missed but the help will be appreciated!
</div>