Site Plan

Solutions For Proposed Promblems

  1. Provide a form to select which tutorial you wanted to view
  2. Query the Database for the corresponding tutorial Using a SELECT statement
  3. Display the tutorials using foreach ($var as $var)
  4. Query the database for the corresponding comments for the tutorial selected using
    a SELECT statement.
  5. Display the comments using foreach ($var as $var)
  6. Require login to leave a comment
  7. After Login provide comment form.
  8. When comment form is submitted INSERT statement into the database

What is happening?

The tutorial you select is submitted the server checks the see if the table named tutorial has a value matching the tutorial you selected. If there is a match then the webpage displays the matchinig data, in this case the tutorial. Simutanelously the comments table is queried to gather the comments that match the corresponding tutorial using a foreign key. If the user is logged in then a form is displayed allowing the user to give feedback. If the user is not logged in he is directed to the log in page via a link. Once the user has register and loged in they can then post a comment.

Comments Table

Table Fields Data Types Other Specs.
Com_id int auto increment
com_title varchar -
com_comments varchar -
tut_id int -
user_id int -

Tutorials Table

Table Fields Data Types Other Specs.
tut_id int auto increment
tut_title varchar -
tut_comments varchar -