-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdetail.php
43 lines (36 loc) · 944 Bytes
/
detail.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
<!DOCTYPE html>
<html>
<head>
<title>Details</title>
<link rel="stylesheet" type="text/css" href="todo.css" />
</head>
<body>
<div style="text-align:left;font-size:200% ;background-color:rgb(243, 199, 56);color:white;margin:auto" >
<p>Keep</p>
</div>
</body>
<?php
require_once "database.php";
if(isset($_GET['id'])) {
$id = $_GET['id'];
$query = "SELECT todoTitle, todoDescription, todoDate FROM todo WHERE id = '$id'";
$result = mysqli_query($conn, $query);
if(mysqli_num_rows($result)==1){
$row = mysqli_fetch_array($result);
if($row){
$title = $row['todoTitle'];
$description = $row['todoDescription'];
$date = $row['todoDate'];
echo "
<h2>$title</h2>
<h3>Description</h3>
<p>$description</p>
<small>$date</small>
";
}
}else{
echo 'no todo';
}
}
?>
</html>