Israel

Israel

  • 696
  • 1.3k
  • 217.1k

Simple update into table doesnt obey...

Dec 30 2022 5:37 PM

Hi Sirs, I wrote these simples codes to update to one and same table. Curiosly, it's update ONLY with the second module. I do check it hours and hours to understand why? I dont see the problem. Anyone can help please.    

<?php
   /*----Module1----*/

    if(isset($_POST['prop1_btn'])) {
    include('testDB.php');
    $question=$_POST["question"];
    $answer=$_POST["answer"];
    
    mysqli_query($conn,"update `champion` set answer='$answer' where question='1.1'");
    }
    
    /*----Module2----*/  
    if(isset($_POST['prop1_btn'])) {
    include('testDB.php');
    $question=$_POST["question"];
    $annexe3=$_POST["annexe3"];
    
    mysqli_query($conn,"update `champion` set annexe3='off' where question='1.1'");
    }
?>

<form action="champion_one.php" method="post">
<table align="center" border="1">
<tr>

<tr>
<td><button type="submit" id="prop1_btn" name="prop1_btn" class="prop1">1</button>
<td style="display:"><input type="text" name="answer" id="answer" placeholder="answer" value="<?= $row['answer']; ?>" class="form-control"></td>
</tr>

<tr>
<td style="display:none"><input type="text" name="off" id="off" value="<?= $row['annexe3']; ?>" class="form-control"></td>
</tr>

  </table>
  </form>


Answers (1)