Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Server-side Scripting _ 2 query in the same page

Posted by: NiceGuy Jun 9 2020, 10:54 PM

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>&emsp;<input type = "reset" value ="Reset" /></td>
</tr>
</form>


Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)