A bit of a Moan
I started the project with no experience of using data driven content in a website so I've had to learn a lot in the past couple of weeks. A bit of a moan here but most of what I've learnt has come from online resources after many, many Google searches as opposed to learning through my seminars. Some PHP learning material was provided but I felt the way in which it was delivered was not particularly ideal for learning. For example being made to complete pointless exercises instead of applying what we'd learnt to our projects was particularly annoying. Last week I didn't attend a seminar so I could actually do work on my project at home instead of wasting time in a seminar applying what I'd learnt to a pointless exercise! These exercises are good hypothetic scenarios to use to learn IF WE NEED THEM but if not, I don't expect to be MADE to complete them. It's like being back at school.
MYSQL Database for Blog
This is what my database table looks like for the blog/news feed.

The table is pretty self-explanitory; there is a field for the news posts id, date, title, content and there is also a field incase the user uploads an image (this field simply stores the image's path rather than the image itself).
Below we can see the current data that the table is holding.

The blog.php page is populated using this data. After wrapping certain php variables in html tags in order for a heavy styling session with css, the blog page currently appears as show below.

MYSQL Database for blog comments
The blog I have created makes use of a commenting system. When the 'comments' link is clicked on the blog post, the page displays a single post view which shows the blog post, the comments and an add comment form - as shown below.

When the user enters information into the form and clicks submit, the data is inputted into the database. It is inserted into a separate table from the blog table and it is assigned to the appropriate blog post with the news_id field. This table is solely for storing comments.
In my next post:
- In my next blog post I will show how I have created a form to post a new blog post as well as upload an image.
- I will also show how I have created a login system so the admin area can be viewed only when a user is logged in.
