I have to update the table if only the three values gets matched. I get a syntax error on trying this. What could be the reason?
$sql1="update target set updvalue='".$val3."' where Id ='".$b."'" AND MId ='".$c."'" AND DID ='".$f."'";
$res1=$this->db->query($sql1);
$sql1="update target set updvalue='".$val3."' where Id ='".$b."' AND MId ='".$c."' AND DID ='".$f."'";
$res1=$this->db->query($sql1);
use this
I think there are to many " between where Id and AND, that is, you have made a typo.
You can use Codeigniter query builder.
$this->db->where('Id',$b);
$this->db->where('MId',$c);
$this->db->where('DID',$f);
$upd_data['updvalue'] = $val3;
$res1=$this->db->update('target',$upd_data);
Let me know if it not works.