Wow It really Works…. thanks pickupman….
I am able to connect with SQL Server DB but a simple model_function gives me some syntactical error. the model_function os:-i
function validateLogin($username, $password)
{
$this->db->select('i_user_id');
$this->db->from('user_master UM');
$this->db->where('UM.vc_username',$username);
$this->db->where('UM.vc_password',$password);
$this->db->where('UM.i_status', 1);
$this->db->where('UM.isdeleted', 0);
if($this->db->count_all_results())
{
$this->db->select('i_user_id');
$this->db->from('user_master UM');
$this->db->where('UM.vc_username',$username);
$this->db->where('UM.vc_password',$password);
$this->db->where('UM.i_status', 1);
$this->db->where('UM.isdeleted', 0);
return $this->db->get()->row()->i_user_id;
}
else
{
return false;
}
}
and error on browser:-
———————-
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near ‘)’.
SELECT COUNT(*) AS numrows FROM (user_master UM) WHERE UM.vc_username = ‘admin’ AND UM.vc_password = ‘admin’ AND UM.i_status = 1 AND UM.isdeleted = 0
———————-
If I modify this query to fire directly in sql server then run good:-
————————
SELECT COUNT(*) AS numrows FROM user_master UM WHERE UM.vc_username = ‘admin’ AND UM.vc_password = ‘admin’ AND UM.i_status = 1 AND UM.isdeleted = 0
————————
(just eliminated the parenthesis in from clause)
how do I fix this problem via CodeIgniter.