0
Guys I’m having trouble running the update on two tables... It worked until recently, but updated the XAMMP I use for testing and simply stopped! New way to run update?
<?php
// RECEBENDO OS DADOS PREENCHIDOS DO FORMULÁRIO DE BUSCA!
$id = isset($_GET['id']) ? $_GET['id'] : '';
include("conecta.php");
//Query que realiza o update na tabela entsaida
$query = "UPDATE `entsaida` SET `saida`= NOW() WHERE id='$id'";
//Query que realiza update no status da senha selecionada
$query2 = "UPDATE `senhas` SET `status`='0' WHERE id = '$id'";
mysqli_query($conn,$query);
mysqli_query($conn,$query2);
//script para voltar a página após update nas tabelas
echo"<script type='text/javascript'>";
echo "alert('Saída cadastrada com sucesso!');";
echo "javascript:window.location='saida.php';";
echo "</script>";
?>
First of all the connection is ok... update in the first table is done, in the second not. How do I proceed? Thank you.
See if it returns an error:
mysqli_query($conn,$query2) or die(mysqli_error($conn));
– rray
No error... will normal. but does not update in the second query2
– Jean Semensi
Past id does not exist. Tried to give a
echo $query2;
and test directly at the bank? to be sure whether or not the update happens.– rray
the id exists... look at the UPDATE output
entsaida
SETsaida
= NOW() WHERE id='15'– Jean Semensi
directly in the bank works... and it worked the update in the two tables until yesterday before the update of the xammp... I tried in other 3 machines and the same problem occurs. so I figured the mistake was in this part.
– Jean Semensi
Technically, I think there is no error and the problem is probably in xammp!
– Jean Semensi
Well I’m solving it another way... I’ll put two different id... so if you continue the mistake I give up!
– Jean Semensi
solved using the password id and not the entry registration id.... separated and left two $id = isset($_GET['id']) ? $_GET['id'] ''; $idpassword = isset($_GET['password']) ? $_GET['password'] : '';
– Jean Semensi
thanks for the help anyway!
– Jean Semensi