CodeIgniter Forums

Full Version: An Error Was Encountered (db)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Ecentric[/eluser]
I get this error
Quote:An Error Was Encountered
Error Number:

ERROR: argument of WHERE must be type boolean, not type integer

SELECT user_jm_id FROM jm_resume WHERE jm_resume_id

from the function
Code:
function find_user_jm_id($jm_resume_id)
{
    $this->db->select('user_jm_id');
    $this->db->from('jm_resume');
    $this->db->where('jm_resume_id', $jm_resume_id);        
    $query = $this->db->get();
    $row = $query->row();
    $query->free_result();
    return $row->user_jm_id;
}

I don't know what cause this error.

El Forum

[eluser]flojon[/eluser]
There shouldn't be any problem with that code.
You should look at the value of $jm_resume_id when this happens,i.e., find the place where this function is called and make sure the argument is sane. It could be that it's set to NULL or FALSE.
You could also switch the where line to this and see if it helps
Code:
$this->db->where(array('jm_resume_id'=>$jm_resume_id));