-
Notifications
You must be signed in to change notification settings - Fork 0
/
ichiran.php
46 lines (42 loc) · 929 Bytes
/
ichiran.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
46
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>アンケート一覧</title>
</head>
<body>
<?php
try
{
$dsn='mysql:dbname=phpkiso;host=localhost';
$user='test';
$password='test1234';
$dbh=new PDO($dsn, $user, $password);
$dbh->query('SET NAMES utf8');
$sql='SELECT * FROM anketo WHERE 1';
$stmt=$dbh->prepare($sql);
$stmt->execute();
while(1)
{
$rec=$stmt->fetch(PDO::FETCH_ASSOC);
if ($rec==false)
{
break;
}
print $rec['code'];
print $rec['nickname'];
print $rec['email'];
print $rec['goiken'];
print '<br />';
}
$dbh=null;
}
catch (Exception $e)
{
print '障害が発生しています。';
}
?>
<br />
<a href="menu.html">メニューに戻る</a>
</body>
</html>