insertClient.php 1.38 KB
Newer Older
1
<!DOCTYPE html>
Oswaldo Aldair Alanis Mayorga's avatar
Oswaldo Aldair Alanis Mayorga committed
2
<html>
3
4
5
6
  <head>
    <meta charset="utf-8">
    <title>Insert Client </title>
  </head>
Oswaldo Aldair Alanis Mayorga's avatar
Oswaldo Aldair Alanis Mayorga committed
7
8
  <body>
    <table border = "1">
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
46
47
      <tr>
        <th> id </th>
        <th> nom </th>
        <th>prenom</th>
        <th> ddn </th>
        <th> adresse </th>
        <th> numero </th>
      </tr>
      <?php
        $vHost = 'tuxa.sme.utc';
        $vPort = '5432';
        $vData = 'dbbdd0p020';
	$vUser = 'bdd0p020';
        $vPass = 'uLd6pAgM';
        $nom = $_POST('nom');
        $prenom = $_POST('prenom');
        $ddn = $_POST('ddn');
        $add = $_POST('add');
        $ntel = $_POST('ntel');
        $vConn = new PDO("pgsql:host=$vHost;port=$vPort;dbname=$vData", $vUser, $vPass);

        $vSql ='INSERT INTO client (nom, prenom, ddn, adresse, numeero) VALUES('$nom', '$prenom', '$ddn', '$add', '$ntel')';
	$vSt = $vConn->prepare($vSql);
        $vSt->execute();

        $vSql ='SELECT * FROM client';
        $vSt = $vConn->prepare($vSql);
        $vSt->execute();
        while ($vResult = $vSt->fetch(PDO::FETCH_ASSOC)) {
          echo '<tr>';
          echo "<td>$vResult[idClient]</td>";
          echo "<td>$vResult[nom]</td>";
          echo "<td>$vResult[prenom]</td>";
          echo "<td>$vResult[ddn]</td>";
          echo "<td>$vResult[adresse]</td>";
          echo "<td>$vResult[numero]</td>";
          echo '</tr>';
        }*/
       ?>
Oswaldo Aldair Alanis Mayorga's avatar
Oswaldo Aldair Alanis Mayorga committed
48
49
    </table>

50
51
52
	
  </body>
</html>