2 query in the same page, I need to place 2 query and a get method + a post method in the same p |
2 query in the same page, I need to place 2 query and a get method + a post method in the same p |
NiceGuy |
Jun 9 2020, 10:54 PM
Post
#1
|
Group: Members Posts: 1 Joined: 9-June 20 Member No.: 27,393 |
Hi,
i'm having some problems with my page, it has to permit the users to modify some data. I this page i need to recive ( i'm using a get method) a name of a person. With that name and a query i show all the person data. The problem is that, in the same page, you have to compile some text box and than use a submit boutton to make another query modify the data on the database. ['m using sql for the database] I've no idea how to deal with that. First query: <?php $conn = miaConnect(); $codiceF = $_GET["codiceF"]; $query = " select *" ." from Account a" . " join Utente u on u.nomeUtente = a.FK_nomeUtente" ." where a.codiceFiscale = '$codiceF'"; $res = mysqli_query($conn,$query); if(!$res){ die("Impossibile eseguire listruzione DML..."); } $row = mysqli_fetch_assoc($res); ?> Table + submit: <table class="datiDipendenti" style="width:100%"> <form action = "modifica.php" method="POST"> <tr class="d0"> <th class="dipendenti">NOME</th> <?php echo"<td class='dipendenti'>".$row["nome"]."</td>";?> <td class="dipendenti"><input type="text" name="nome" value="<?php if (isset ($row["nome"])){ $nome =$row["nome"]; echo ($nome); }else{ echo ""; } ?>"/></td> </table> Ty so much 4 the help! </tr> <tr> <td><input type = "submit" value ="Modifica" /></td> <td> <input type = "reset" value ="Reset" /></td> </tr> </form> |
Lo-Fi Version | Time is now: 13th May 2024 - 12:35 AM |