[eluser]whobutsb[/eluser]
Hello All
I'm running into some issues with querying my MSSQL Database. I have a DB that is pulling a list of employees from Active Directory into a View. Everything works fine with the view and I have used it in the past but not with CI.
I now have a CI Model that is supposed to search the table using the WHERE LIKE statement.
My Model looks like this:
Code:
class NHCEmployee_model extends Model{
var $NHCUsers;
function NHCEmployee_model(){
parent::Model();
$this->NHCUsers = $this->load->database('NHCUsers', TRUE);
}
function search_employees($displayname){
$this->NHCUsers->select('displayname, username');
$this->NHCUsers->like('displayname', $displayname);
$query = $this->NHCUsers->get('tblNHCEmployees');
return $query->result();
}
}
I have the the Database all set up perfectly in CI with the correct User/Pass. But whenever I run the query I get this error message:
Code:
<h1>A Database Error Occurred</h1>
<p>Error Number: 7405</p><p></p><p>SELECT displayname, username
FROM tblNHCEmployees
WHERE displayname LIKE '%ste%'</p>
Is there any way to debug these Error Numbers? When I run this query in MSSQL Management Query it performs fine.
Thank you for the help!