Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
OI pessoal , estou com problemas para fazer o update de dois campos da minha tabela.
Abaixo vão os código em php:
<?php require "../con_check/conn.php";
include "../lab_montagem/topo_mont.php";
$id = $_POST["id"];
$datdes = $_POST["datdes"];
$obs2 = $_POST["obs2"];
if ($datdes ==""){
echo "<html><body>";
echo "<p align=\"center\">Digite a data de descarte!</p>";
echo "<p align=\"center\"><a href=\"../lab_montagem/lab_cad_desc2.php\">Voltar</a></p>";
echo "</body></html>";
exit();
}
$sql = "UPDATE montagem SET";
$sql .="datdes='".$datdes;
$sql .="',obs2='".$obs2;
$sql .= " WHERE idmont=".$id;
$e = mysql_query($sql) or die (mysql_error());
o erro qeu dá na tela é:
"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '='22/05/2009',obs2='UHUIUYHGYU WHERE idmont=137' at line 1"
meus codigos sql estão abaixo:
/Table structure for table montagem /
DROP TABLE IF EXISTS `montagem`;
CREATE TABLE `montagem` (
`idmont` int(11) NOT NULL auto_increment,
`banho` text NOT NULL,
`tipo` text NOT NULL,
`tanque` text NOT NULL,
`volume` text NOT NULL,
`fornecedor` text NOT NULL,
`processo` text NOT NULL,
`datamont` text,
`responsavel` text,
`previsao` varchar(10) NOT NULL default '00/00/0000',
`datadesc` text,
`respdesc` text,
`obs` text,
`obs1` text,
`datdes` varchar(10) default '00/00/0000',
`obs2` text,
PRIMARY KEY (`idmont`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;Alguém pode me dar um help!!!!valeu pessoalCarregando comentários...