-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.php
More file actions
31 lines (27 loc) · 920 Bytes
/
install.php
File metadata and controls
31 lines (27 loc) · 920 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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>TODO Installer</title>
</head>
<body>
Beginning installation...<br>
<?php
echo "Connecting database.. ";
include("dbconnect.php");
echo "Done <br>";
echo "Creating tables.. ";
$query1 = "CREATE TABLE IF NOT EXISTS `todo` (`id` int(11) NOT NULL AUTO_INCREMENT, `desc` varchar(200) NOT NULL, `date` date NOT NULL, `done` int(11) NOT NULL, PRIMARY KEY (`id`))";
$x = mysqli_query($con, $query1);
$query2 = "CREATE TABLE IF NOT EXISTS `scrap` (`desc` varchar(1024) NOT NULL, `timestamp` timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`timestamp`))";
$y = mysqli_query($con, $query2);
if($x==1 && $y==1){
echo "Done <br>";
}
else{
echo "Error during installation <br>";
}
mysqli_close($con);
?>
</body>
</html>