戻る      schedule_read.php      schedule_delete.php     

《PHP言語 /schedule_read.php》

<?php
$db=sqlite_open("schedule.sqlite",0666,$err);
$rs=sqlite_query("SELECT * FROM schedule ORDER BY s_date,s_time",$db);
?>
<html>
<head>
<title>簡易スケジュール帳</title>
</head>
<body>
<h1 style="background:#cccccc">簡易スケジュール帳</h1>
<table border="1">
<tr>
<th>日付</th><th>時刻</th><th>予定名</th><th>備考</th><th>削除</th>
</tr>
<?php while($row=sqlite_fetch_array($rs)){ ?>
<tr>
<td><?php print($row['s_date']); ?></td>
<td><?php print($row['s_time']); ?></td>
<td><?php print($row['title']); ?></td>
<td><?php print($row['memo']); ?></td>
<td>
<input type="button" value="削除"
onclick="location.href='schedule_delete.php?sid=<?php print($row['sid']); ?>'" /></td>
</tr>
<?php
}
sqlite_close($db);
?>
</table>
</body>
</html>


《PHP言語 /schedule_delete.php》

<?php
$db=sqlite_open("schedule.sqlite",0666,$err);
sqlite_query($db,"DELETE FROM schedule WHERE sid='".sqlite_escape_string($_GET['sid'])."'");
sqlite_close($db);
header("Location: schedule_read.php");
?>