-
Notifications
You must be signed in to change notification settings - Fork 0
/
editar_conta.php
45 lines (35 loc) · 1.01 KB
/
editar_conta.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
$dbh = new PDO('mysql:host=localhost;dbname=pdo', 'root', '');
$sql = "SELECT id, nome, saldo FROM contas WHERE id=:Id";
$prepareQuery = $dbh->prepare($sql);
$prepareQuery -> bindParam(":Id", $_GET["id"], PDO::PARAM_INT);
$prepareQuery -> execute();
if($row=$prepareQuery->fetch(PDO::FETCH_ASSOC)){
?>
<h1>Editar Conta</h1>
<form action="editar_conta_ok.php" method="POST">
<table width="50%" border="1">
<tr>
<td width="20%"> ID: </td>
<td width="80%"> <input type="text" readonly="readonly" name="txtID" value="<?php echo $row["id"]; ?>"> </td>
</tr>
<tr>
<td width="20%"> Nome: </td>
<td width="80%"> <input type="text" name="txtNome" value="<?php echo $row["nome"]; ?>"> </td>
</tr>
<tr>
</tr>
<tr>
<td width="20%"> Saldo: </td>
<td width="80%"> <input type="text"name="txtSaldo" value="<?php echo $row["saldo"]; ?>"> </td>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
<td width="20%"></td>
<td width="80%"> <input type="submit" value="Editar"> </td>
</tr>
</form>
<?php } ?>