-1
I have a problem doing Database Update.
$AcidenteValidade = $_POST["AcidenteValidade"];
$AcidenteAnexo='';
if (isset($_FILES["AcidenteAnexo"]) && $_FILES["AcidenteAnexo"]["name"] != '') {
$nomeTemporario = $_FILES["AcidenteAnexo"]["tmp_name"];
$fp = fopen($nomeTemporario, 'r');
$AcidenteAnexo = fread($fp, filesize($nomeTemporario));
$AcidenteAnexo = addslashes($AcidenteAnexo);
fclose($fp);
}
$consulta2 = "UPDATE tb_trabalhador SET AcidenteAnexo='.$AcidenteAnexo.' WHERE id=$id";
mysql_query($consulta2) or die(mysql_error());
The problem is the AcidenteAnexo
that appears as:
Indefinite. Notice: Undefined variable: Accidentalannexe
in which line you’re making the mistake?
– Math
what appears if you do this: echo $nameTemporario = $_FILES["Accidental"]["tmp_name"]; ???
– pc_oc
The error line is the line Query 2
– ChrisAdler
so you never get into if, right? guess you can’t just use $_FILES["Accidentalannex"].
– pc_oc
If is for me to check whether or not there is a modified document
– ChrisAdler
Reviewing this, I edited "update of Database" and maybe it would be better to "update in Database". . This is the suggestion for the next editor.
– brasofilo