0
Since yesterday I have been having a very strange problem at the time and update data in my BD. I always managed to update data, but I haven’t been able to with this command:
if(isset($_POST['salvarNao'])){
$acordoo = $_POST['acordoo'];
$dataProximaAudi = $_POST['dataProximaAudiencia'];
$dataP = explode('-', $dataProximaAudi);
$dataProximaAudi = $dataP[0].$dataP[1].$dataP[2];
$sqlNao = "UPDATE [RDO].[dbo].[reclamatoria] SET acordoNAO='$acordoo', dataProximaAudiencia='$dataProximaAudi' WHERE ID='$id_reclamatoria'";
$stmt = sqlsrv_query( $conn, $sqlNao );
}
Is there something wrong with my code? the current date I have in the bank is 1900-01-01 00:00:00, field datetime
Is there an error? update works directly in the bank? if
$dataP
is in formattedyyyy-mm-dd
don’t need the explosion.– rray
No error is presented and if I run straight into the bank, it works! Updates!
– GustavoSevero
UPDATE [RDO]. [dbo]. [reclamatoria] SET acordoNAO='No', dataProximaAudiencia='20150122' WHERE ID='96'
– GustavoSevero
You have the variable
$id_reclamatoria
setted? Of aecho
inquery
to see what she’s riding on.– Oeslei
I’m doing a separate update. I tried to update a field first, and it didn’t work, and then dataProximaAudiencia and it worked. So the problem is in the agreed field.
– GustavoSevero
I don’t know why, but the field acordoNAO, is not accepting "~" (til), being that it is an nvarchar field(3)... I had to take the pencil to get him into the bank.
– GustavoSevero