Skip to content

The 01_php_blog_project is a video game blog with CRUD operations entirely developed with PHP as programming language and MySQL for the database.

Notifications You must be signed in to change notification settings

davidlozadadev/01_php_blog_project

Repository files navigation

01_php_blog_project

Project's status: finished ✔️

Index

  1. Introduction

    1.Motivation behind the project

    2.Naming convention

    3.Database schemas

    4.Blog layouts

  2. Technical aspects

    1.Triggers

    2.Includes

  3. Contributor

Introduction

1.1 Motivation behind the project

This project's purpose is to use basic PHP and MySQL knowledge to build a video game blog where signed-up users can create, read, update and detele entries about their favorite video games. At the same time, if a certain category isn't set yet, they can create it and make it available for everyone to use it, as well as, the registered users can modify their profile information. Those features were developed by using tools such as Dia for making the database schemas and HeidiSQL for exporting under some standars the database coded on the MySQL Command-Line.

Technologies/tools used for this project

1. CSS
2. Dia
3. HeidiSQL
4. HTML5
5. MySQL
6. PHP 

1.2 Naming convention

  1. The table names are in plural and lowercase.

    E.g: users.

  2. The column names are fully human-readable, in order to make that possible the names are in singular and use camelCase naming practice followed by an underscore and then the first three letters of the table's name where each column belongs to.

    E.g: userName_use. This is a column that belongs to a table called "users".

  3. The primary key column names use as default name "ID" followed by an underscore and then the first three letters of the table's name where each primary key column belongs to.

    E.g.: ID_use. This is a primary key column that belongs to a table called "users".

1.3 Database schemas

Related tables

The 1st schema shows the tables that are in the database and how they are related to each other through one-to-many relationships.

01 schema


Non-related tables

The 2nd schema show the tables thar are not related with each other in the database, these have as main function to backup all the data from the related tables.

02 schema


1.4 Blog layouts

About me

The about me layout shows information about the site owner.

About me


Category

The category layout is used to show all the entries from a particular category.

Category


Contact me

The contact me layout displays the contact information for the site owner.

Contact me


Create category

The create category layout presents a form to create a category.

Create category


Create entry

The create entry layout presents a form to create an entry.

Create entry


Edit profile

The edit profile layout shows a form to update the user's profile information.

Edit profile


Home page

The home page layouts displays the last 5 entries.

Home page


Signed in

The signed in layout is the first page a user gets once is signed in.

Signed In


Technical aspects

2.1 Triggers

categories_backup_trigger

The categories_backup_trigger inserts into the categories_backup table all the record's data before being deleted from the categories table.

DELIMITER //
CREATE TRIGGER categories_backup_trigger BEFORE DELETE ON categories FOR EACH ROW 
BEGIN
INSERT INTO categories_backup VALUES(OLD.ID_cat, OLD.name_cat);
END//
DELIMITER ;

entries_backup_trigger

The entries_backup_trigger inserts into the entries_backup table all the record's data before being deleted from the entries table.

DELIMITER //
CREATE TRIGGER entries_backup_trigger BEFORE DELETE ON entries FOR EACH ROW 
BEGIN
INSERT INTO entries_backup VALUES(OLD.ID_ent, OLD.ID_use, OLD.ID_cat, OLD.title_ent, OLD.description_ent, OLD.date_ent);
END//
DELIMITER ;

users_backup_trigger

The users_backup_trigger inserts into the users_backup table all the record's data before being deleted from the users table.

DELIMITER //
CREATE TRIGGER users_backup_trigger BEFORE DELETE ON users FOR EACH ROW 
BEGIN
INSERT INTO users_backup VALUES(OLD.ID_use, OLD.name_use, OLD.surname_use, OLD.email_use, OLD.password_use, OLD.date_use);
END//
DELIMITER ;

2.2 Includes

db_connection

This file is used to connect to the database.


footer

This file stores the footer module.


header

This file stores the header module.


helper

This file stores a set of functions that are implemented in the code.


redirect

This file stores a redirection action.


sidebar

This file stores the modules of search box, sign in and sign up.


3 Contributor

Copyright © 2021 David Lozada

About

The 01_php_blog_project is a video game blog with CRUD operations entirely developed with PHP as programming language and MySQL for the database.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published