Tuesday, 16 December 2014

Blog Script that I wrote for a Database Project

Here's something that I wrote as a project for database systems' course in my university. Not something big but just merely a demonstration of how databases work with web applications.

Confession: I took the stylesheet from some random website, had to make the blog look kinda nice xD

This blog is an application with a graphical user interface that will be coded in
PHP as the front end and MySQL as the back-end database.

Following are the technologies will be used in this application:
  • HTML + CSS aka xHTML
  • PHP
  • MySQL




            Entity Relationship Diagram of the Database





Queries For Creating Tables


Table: user
CREATE TABLE user (
 user_id INT(11) NOT NULL AUTO_INCREMENT,
 username VARCHAR(32) NOT NULL,
 password VARCHAR(35) NOT NULL,
 PRIMARY KEY(user_id)
);


Table: posts
CREATE TABLE posts (
 post_id INT(6) NOT NULL AUTO_INCREMENT,
 post_title VARCHAR(255), 
 post_body TEXT,
 post_user INT(11),
 post_date DATETIME, 
 FOREIGN KEY (post_user) REFERENCES user(user_id) ON DELETE CASCADE,
        PRIMARY KEY(post_id)
);

Table: comments
CREATE TABLE comments (
 comment_id INT(6) NOT NULL AUTO_INCREMENT,
 post_id INT(6),
 comment_body TEXT,
 comment_user INT(11),
 comment_date DATETIME,
 
        FOREIGN KEY (post_id) REFERENCES posts(post_id) ON DELETE CASCADE,
 PRIMARY KEY(post_id)
);


                                            Download Here
 
        Password: securityblogger.ninja

1 comment:

  1. I thought it was some wordpress template you are using until I saw this post. Really nice man ;)

    ReplyDelete