diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..62a0672 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "db"] + path = db + url = https://github.com/bckelley/SimplePHPDB.git diff --git a/_config.yml b/_config.yml deleted file mode 100644 index 2f7efbe..0000000 --- a/_config.yml +++ /dev/null @@ -1 +0,0 @@ -theme: jekyll-theme-minimal \ No newline at end of file diff --git a/db b/db new file mode 160000 index 0000000..f3f6a5a --- /dev/null +++ b/db @@ -0,0 +1 @@ +Subproject commit f3f6a5a7de98a628511f3bd3c34170faeba43942 diff --git a/index.php b/index.php index c272c76..95be2ee 100644 --- a/index.php +++ b/index.php @@ -2,10 +2,12 @@ if (isset($_GET['edit'])) { $id = $_GET['edit']; $update = true; - $record = mysqli_query($db, "SELECT * FROM tasks WHERE id=".$id); - if ( $record ) { - $n = mysqli_fetch_array($record); - $task = $n['task']; + $row = $db->getRows("`todo-tasks`", ['where' => ['id' => $id]]); + if ( $row ) { + + foreach ( $row as $r ) { + $task = $r['task']; + } } } ?> @@ -17,6 +19,8 @@
| Action | |||
|---|---|---|---|
| - | - | - Edit - | -- Delete - | -
| + | + + + + | ++ Edit + Delete + | +|
| No tasks available. | |||