CSci 1101 Lab 6. Due Tuesday, March 30 at 11:59pm

Work in groups of two.

Retrieving data from the database (15 points)

Based on the php examples in class, write and test a php program that performs the following queries. Please display all the results on the page (so that there is no need to change your php code to change the query).

It's a good idea to try your queries in phpMyAdmin first.

  1. Select all comments that were posted between Jan 25 and Feb. 3 (including). Display the comment ID, the author name, and the contents.
  2. Select all comments whose author has a letter 'a' in their user name. Display the comment ID, the author name, and the contents.
  3. Select all comments whose author does not have a letter 'a' in the user name (hint: use NOT). Display the comment ID, the author name, and the contents.
  4. Select all posts (post content, author name, and comment count) that have no more than 10 comments.
  5. Select all posts that have a comment with the word "Alex" in it. Specifically, you need to select the post content and the comment contents and author of that comment.

To submit

Send me an e-mail with the URL of the file when done. Both group partners should be on CC list for this.


CSci 1101 course web site.