Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <!--
- To change this license header, choose License Headers in Project Properties.
- To change this template file, choose Tools | Templates
- and open the template in the editor.
- -->
- <html>
- <head>
- <meta charset="UTF-8">
- <title></title>
- </head>
- <body>
- <?php $afdnr = 0;
- if(!empty($_GET["verzenden"])){
- $afdnr = $_GET["afdnr"];
- }
- //
- // $nrRows = $stmt->rowCount();
- // if($nrRows = 0){
- // print"Helaas is er nu geen record.";}
- ?>
- <form method="get">
- Afdelingnr: <input type="text" name="afdnr" value="<?php print$afdnr;?>">
- <input type="submit" name="verzenden" value="Verzenden">
- <br/>
- <br/>
- <?php
- $db ="mysql:host=localhost;dbname=cursus;port=3307";
- $user ="root";
- $pass = "usbw";
- $pdo = new PDO($db, $user, $pass);
- // $afdnr = $_GET["afdnr"];
- $stmt = $pdo->prepare("SELECT * FROM medewerker where afd = ?");
- $stmt->execute(array($afdnr));
- while ($row = $stmt->fetch())
- {
- $naam = $row["naam"];
- $functie = $row["functie"];
- print($naam .", ". $functie ."<br>");
- }
- $pdo = NULL;
- ?>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement