From 1dd7ec96cbd0cca959a754eb9e322e590d87672c Mon Sep 17 00:00:00 2001 From: roun512 Date: Sun, 12 Apr 2015 08:45:42 +0300 Subject: [PATCH 1/6] Now it creates the database and made it smaller --- sql/my_blog.sql | 50 +++++++++++-------------------------------------- 1 file changed, 11 insertions(+), 39 deletions(-) diff --git a/sql/my_blog.sql b/sql/my_blog.sql index 43f7ff8..2169bbd 100644 --- a/sql/my_blog.sql +++ b/sql/my_blog.sql @@ -18,6 +18,9 @@ SET time_zone = "+00:00"; -- -- Database: `my_blog` +DROP DATABASE IF EXISTS my_blog; +CREATE DATABASE my_blog; +USE my_blog; -- -- -------------------------------------------------------- @@ -27,12 +30,13 @@ SET time_zone = "+00:00"; -- CREATE TABLE IF NOT EXISTS `posts` ( -`post_id` int(11) NOT NULL, +`post_id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `title` varchar(255) NOT NULL, `contents` text NOT NULL, `posted_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `filename` varchar(255) NOT NULL + `filename` varchar(255) NOT NULL, + PRIMARY KEY (`post_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -------------------------------------------------------- @@ -42,46 +46,14 @@ CREATE TABLE IF NOT EXISTS `posts` ( -- CREATE TABLE IF NOT EXISTS `users` ( -`user_id` int(11) NOT NULL, +`user_id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(30) NOT NULL, `password` varchar(35) NOT NULL, `fname` varchar(20) NOT NULL, `lname` varchar(20) NOT NULL, `email` varchar(255) NOT NULL, `gender` varchar(6) NOT NULL, - `avatar` varchar(255) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - --- --- Indexes for dumped tables --- - --- --- Indexes for table `posts` --- -ALTER TABLE `posts` - ADD PRIMARY KEY (`post_id`); - --- --- Indexes for table `users` --- -ALTER TABLE `users` - ADD PRIMARY KEY (`user_id`), ADD UNIQUE KEY `username` (`username`,`email`); - --- --- AUTO_INCREMENT for dumped tables --- - --- --- AUTO_INCREMENT for table `posts` --- -ALTER TABLE `posts` -MODIFY `post_id` int(11) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT for table `users` --- -ALTER TABLE `users` -MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; + `avatar` varchar(255) DEFAULT NULL, + PRIMARY KEY (`user_id`), + UNIQUE KEY (`username`,`email`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; \ No newline at end of file From 2dacde80c34f673e88a6650da5850f8f6f1afeb2 Mon Sep 17 00:00:00 2001 From: roun512 Date: Sun, 12 Apr 2015 08:59:15 +0300 Subject: [PATCH 2/6] Added .gitignore to prevent some files from being pushed --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4e9b47a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +config.php \ No newline at end of file From 2cf3f1d3f1ed4f46977c875d02ebb07520cb2caf Mon Sep 17 00:00:00 2001 From: roun512 Date: Sun, 12 Apr 2015 09:00:35 +0300 Subject: [PATCH 3/6] It now listens to config.php --- resources/conx.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/conx.php b/resources/conx.php index 936b528..d5413a9 100644 --- a/resources/conx.php +++ b/resources/conx.php @@ -1,5 +1,8 @@ Date: Sun, 12 Apr 2015 09:01:15 +0300 Subject: [PATCH 4/6] Added config.php --- example.config.php | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 example.config.php diff --git a/example.config.php b/example.config.php new file mode 100644 index 0000000..8385a18 --- /dev/null +++ b/example.config.php @@ -0,0 +1,10 @@ + \ No newline at end of file From 9749fc30b37e8311ddb1af280c0c18a4b623e341 Mon Sep 17 00:00:00 2001 From: roun512 Date: Sun, 12 Apr 2015 09:04:15 +0300 Subject: [PATCH 5/6] It now listens to config.php --- resources/conx.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/conx.php b/resources/conx.php index d5413a9..e9d1a1a 100644 --- a/resources/conx.php +++ b/resources/conx.php @@ -1,5 +1,5 @@ Date: Sun, 12 Apr 2015 09:06:02 +0300 Subject: [PATCH 6/6] fixed the path of config.php --- resources/conx.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/conx.php b/resources/conx.php index e9d1a1a..2bf7e92 100644 --- a/resources/conx.php +++ b/resources/conx.php @@ -1,5 +1,5 @@