-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtable.php
More file actions
39 lines (27 loc) · 822 Bytes
/
table.php
File metadata and controls
39 lines (27 loc) · 822 Bytes
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
<?php
$dbname='members.db';
$mytable ="member";
if(!class_exists('SQLite3'))
die("SQLite 3 NOT supported.");
$base=new SQLite3($dbname, 0666);
$query = "SELECT ID, NAME, GRADE, SCHOOL, GENDER, PHONE, MAIL, FAVOR, WORK FROM $mytable";
$results = $base->query($query);
while($arr = $results->fetchArray())
{
if(count($arr) == 0) break;
echo "<tr>\n";
$id = $arr['ID'];
$name = $arr['NAME'];
$grade = $arr['GRADE'];
$school = $arr['SCHOOL'];
$gender = $arr['GENDER'];
$phone = $arr['PHONE'];
$mail = $arr['MAIL'];
$favor = $arr['FAVOR'];
$work = $arr['WORK'];
$text_gender = ($gender==0) ? "男":"女";
$text_work = ($work==0)? "否":"是";
echo $id.",".$name.",".$grade.",".$school.",".$text_gender.",".$phone.",".$mail.", \"".$favor."\",".$text_work.",";
echo "<br/>";
}
?>