I have a update
that is done in the following way.
public function update_donante($tabla,$caso,$link,$campo,$tipodonante){
$this->tabla=$tabla;
$this->caso=$caso;
$this->con=$link;
$this->campo=$campo;
$this->tipodonante=$tipodonante;
$this->sqll= "UPDATE ".$this->tabla." SET ".$this->campo."='".$this->tipodonante."' WHERE idCaso="."'".$this->caso."'";
//die($this->sqll);
$this->resull=mysql_query($this->sqll,$this->con);
}
this is sent with a function ajax
, and return with a die();
to get the query
per screen and see what comes out.
the query
is as follows
UPDATE patient_data SET donor_type = 'Donor' WHERE idCaso = '159'
It is well written but when I generate it directly by the mysql
it is ok updates the field, but when I do it from the code it updates the field to 1.
The field is in nvarchar 200
that is more than I need and the variables are correct.
Can someone help me with this?