Project assignment 3. Due Tuesday, April 6 at 11:59pm

Displaying database data

For this project installment you need to display posts and comments using the data stored in the database. Use your team database. I will send you information by e-mail during the Spring break or shortly after. Meanwhile, you can use the wordpress database. Use the 1101readonly account to access it. Please do not use your admin database account in your php code.

The pages should be connected to each other by links. Copy the files from project assignment 2 into a separate directory so that the old files can be graded. Below are the details of this project assignment:

  1. You need to write a php file for displaying posts, another file for displaying comments, and another one displaying information about a user (such as name, display name, and a link to the user's website, if any). You may also have a file with some sort of "front page" of the blog, but this is optional. In addition you should have auxiliary php files with functions and other code used by different files of the program, such as database information (username, password, etc.), database queries, etc.. Make sure not to duplicate code unnecessarily: use functions whenever possible.
  2. To display posts: the posts should be retrieved from the database using the SELECT statement. If posts are added to the database then reloading the page should show the change.
  3. Set a limit on how many posts you can display on a page.
    As an extra feature, you may add a link "more" at the end of the page that will display the next group of posts. To get the maximum credit for this part, make sure that there is no "more" link on the last page.
  4. Post titles should be links to the page with the post and its comments. The text showing the number of comments to a post (for instance, "5 comments") should link to the comments page as well. The words "Comment on it" for now may link to the same page since we don't yet have forms for adding a comment.
  5. To display an individual post and comments:Use the GET method (i.e. extended URLs) to pass the parameter to this page which is the post ID. Using the ID, select the post and its comments from the database.
  6. Just as with posts, set a limit on how many comments you can display on a page.
  7. To display user information: Clicking on user name on any page should bring up the page that displays information about that user. It's OK if the page doesn't have much information on it. Use GET method to pass the user ID to the page.

Requirements


This page is a part of CSci 1101 course web site.