From b6cc8dd776dde720cd9cbe857751841551e4283a Mon Sep 17 00:00:00 2001 From: Elyrith Date: Fri, 9 Aug 2013 20:44:18 -0400 Subject: [PATCH] Create table for users and admin user --- .gitignore | 1 + blogtable.sql | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4276bf9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +index.php diff --git a/blogtable.sql b/blogtable.sql index beeeae2..6e8d492 100644 --- a/blogtable.sql +++ b/blogtable.sql @@ -1,7 +1,18 @@ CREATE TABLE `blog` ( - `postnumber` int(11) NOT NULL AUTO_INCREMENT, + `postnumber` int(11) NOT NULL AUTO_INCREMENT, `date` date NOT NULL, `title` text COLLATE utf8_unicode_ci NOT NULL, `posttext` text COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`postnumber`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +CREATE TABLE `users` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `username` varchar(20) NOT NULL, + `name` varchar(40) NOT NULL, + `password` varchar(64) NOT NULL, + `session` int(64), + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +INSERT INTO `users` (`id`, `username`, `name`, `password`, `session`) VALUES (NULL, 'admin', 'Admin', PASSWORD('admin'), NULL);