I need to know how to manage a PHP page in which once you push a confirm button inside the database in MySQL connected to the PHP file the tuple of a table (x) is sending to a table (y) and then they are deleted from the table (x).
This is my code:
Primo file ricerca.php
  <tr>
    <td> <?php echo $row['Nome_richiedente']; ?></td>
    <td> <?php echo $row['Cognome_richiedente']; ?></td>
    <td> <?php echo $row['Indirizzo_richiedente']; ?></td>
    <td> <?php echo $row['Città_richiedente']; ?></td>
    <td> <?php echo $row['Tipo_richiesta']; ?></td>
    <td> <?php echo $row['email_cliente']; ?></td>
    <td> <?php echo $row['Descrizione_richiesta']; ?></td>
    <form method="post" >
        <input type="submit" name="button1" value="Button1"/> 
  </tr>
                        
<?php
    if(array_key_exists('button1',$_POST)){
        include "prova.php";
        funziona();
    }
  }
}
?>
  </table>
 </body>
</html>
Secondo file prova.php
 <?php
    function funziona() {
        $connessione= mysqli_connect("localhost","root","","db_tech");
        $query_insert = "INSERT INTO richista_c SELECT * FROM richiesta;";
         echo "Function Exists";
    }
 ?>
 
     
    