Database Development

To develop a system where users are able to register, login and submit we must understand that a database is needed in order for this to work. As described in my earlier post on the ‘Design for Databases’ I need to make sure that I have the relevant rows in a table, and there may be more than one table. And in some cases, these tables may have pull data from other tables.

Using software known as ‘phpMyAdmin’ I am able to install the SQL database onto my server. And because I set up Apache on my Macbook I was also able to setup ‘phpMyAdmin’ on there too. If you are interested in setting up an SQL database check out this link and follow the instructions.

I was also advised by Kyle (my teacher) to download an app that allowed me to interact with the GUI of the SQL databases. Known as ‘Sequel Pro’ I am able to do everything ‘phpMyAdmin’ does but in a richer UI experience. If you are interested in that, you can download it here. (Mac’s only).

Below is our structure design for the user’s information in the users table:

users_strucutre

Each row has been designed with the correct data types:

  • INT – Used for the id for each user (Primary Key)
  • VARCHAR – Each row with this data type can carry any character (numbers, letters and symbols)

Below is the users table in content form, as we can see some examples how the data is held:

users_content

As we can see there is six columns of information:

  • id
  • username
  • password
  • first name
  • last name
  • email

This table will be fairly straightforward to link up to using PHP forms and coding communications. The only fields that will be required to sign-in are username and password, so the process will be fairly simple to code in the future.

The post table is going to be slightly harder to produce, as the fields need to be refine-able in the search options of the web app.

Below is our structure design for the post information in the posts table:

post_content

Again, each row has been designed with the correct data types:

  • INT – Used for the id for each user (Primary Key)
  • VARCHAR – Each row with this data type can carry any character (numbers, letters and symbols)
  • Length – Certain fields have limited characters so the web app is more controlled when displaying relevant data

Below is the posts table in content form, as we can see some examples how the data is held:

post_structure

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s