Database Structure Implemented


I have now created the database structure that I sketched on paper, in phpmyadmin, although I had to make some changes. Because of my limited PHP knowledge, there are some limitations on the project, and so some fields had to be removed. The same two tables as I initially planned were created, ‘User’ and ‘Holiday’.

The ‘User’ table remained the same as the initial plan, as it was a fairly basic table to begin with:
Screen Shot 2015-04-15 at 15.00.15
(‘User’ table showing fields: user_id, user_name, user_password, user_city, date_joined, user_forename, user_surname, user_dob)

The ‘Holiday’ table had some changes made to it. I didn’t have the time to create a tagging system, so ‘holiday_tags’ was removed. I was also unable to allow users to upload a picture, as we don’t yet have permissions to do this, so ‘holiday_picture’ was removed. Otherwise, the design of the ‘Holiday’ table remained the same:
Screen Shot 2015-04-15 at 14.57.26
(‘Holiday’ table showing fields: holiday_id, holiday_location, holiday_description, holiday_rating, holiday_user)

Both the ‘User’ and ‘Holiday’ tables required a key field, to allow each entry to be uniquely identified. These were the ‘user_id’ and ‘holiday_id’ respectively. The values in these fields are generated automatically as an entry is added.

At this stage in the project both tables appear to be working correctly, and are communicating with the database so hopefully I am finished working on them, but changes may have to be made as the project progresses.


Setting Up The Database

With a final idea decided on, the next step in the creation of our web application was to create the back end database for it. I began thinking about the table structure that would be required to achieve what we are looking for. So far, I have only identified two tables that would be required, but this may change as development continues.tumblr_nl3w2oqys81se0a2do1_1280


At the minute I only have a USERS table and a HOLIDAY table. The USERS table will allow users to create an account to store their detail, as well as login details so they can access their account. The HOLIDAY table will store data that the user inputs about a holiday. The one-to-many relationship of the tables will allow each user to create multiple entries about holidays, but each holiday entry can only be created and edited by one user.