Webbserverprogrammering 1

Show sourcecode

The following files exists in this folder. Click to view.

webbsrvprg/exercises/ajax/extra1/

createtable.php
delete.php
extra1.php
select.php
service.php
signIn.php

select.php

29 lines ASCII Windows (CRLF)
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <?php 
    
/** @var PDO $dbconn */
    
include "../../../dbconnection.php";

    try {
      
$sql "SELECT * FROM ajaxextra1";
      
$stmt $dbconn->prepare($sql);

      
$data = array();
      
$stmt->execute($data);

      while (
$res $stmt->fetch(PDO::FETCH_ASSOC)) {
        echo 
$res["username"] . "<br>";
      }

    } catch (
PDOException $e) {
      echo 
$e;
    }
  
?>
</body>
</html>