Update in two tables using php mysql stopped working

Asked

Viewed 26 times

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));

  • No error... will normal. but does not update in the second query2

  • 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.

  • the id exists... look at the UPDATE output entsaida SET saida= NOW() WHERE id='15'

  • 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.

  • Technically, I think there is no error and the problem is probably in xammp!

  • Well I’m solving it another way... I’ll put two different id... so if you continue the mistake I give up!

  • 1

    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'] : '';

  • thanks for the help anyway!

Show 4 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.