MySQL and PHP - CIT32

Weekly Schedule

Week Information
Assignments due in one week unless otherwise stated. I may add some things during the week, so double check the schedule each week! Please keep copies of all work you submit until you receive your final grade at the end of the semester.
Week #15
Week of May 10th
The college has sent you a survey about the CIS Department, please try to respond! Thanks! We will finish up sessions and then we will have an open lab for help on Wednesday.
Assignments:
The final exam must be passed in prior to the start of the final or you must come to the final and finish the exam.
Final Exam
The required status sheet will be posted by Thursday.
Week #14
Week of May 3rd
Activities this week:
Monday, May 3rd (11:00 in K101), speaker from Meditech coming to my 11:00 class to talk about careers, skills etc., you are invited to join us in K101.
Wednesday, May 5th (7PM - 9PM in G Building Atrium), panel discussion about careers in computing and starting a business
Thursday, May 6th (12:30 in C111), Chad Barraford talking about setting up a computer to be your personal assistant
I sent more details to you in an email to your BCC account.
We will start the week doing cookies.
Cookie Notes
I want you to look at information about sessions:
Session Notes - start
Session Notes
Assignments:
Here are three working models of a JavaScript/XHTML quiz:
quiztotry
quiztotrynopass
quiztotryall
This week I am giving you a project that will also be a major part of the final (graded as a project and as part of the final). I would like you to modify one of the sample quizzes so it is a quiz for this class. You need to take in information about the user so you can set up a record in a table for them with the points they got and their grade. You then need to send the instructor and the student an email giving them their grade. The student has to login in with their userid and if they have already taken the quiz they should be told that they cannot take it again. For extra credit you can take the questions randomly from a database so everyone will get a different quiz. For extra credit you can also figure out how to time the quiz and only give a certain amount of time to take it.
We will look at session information (see examples).
I want you to look at information about sessions:
Session Notes - start
Session Notes
Decoding problem
Week #13
Week of April 26th
I will be around Monday afternoon from 3 to 4 (maybe 2 to 4, I need to check), Tuesday at 10 and at 2, Wednesday at 2. If you need help, please see me!
We will continue with email this week, check back to see where we go from there!
We are going to spend some time working with functions:
Function examples
Decoding challenge:
I want you to decode a word and return the decoded result. You need to use explode for this assignment. Take in the code dtgcm and find the location of each in the alphabet (I want you to explode the alphabet into an array). When you find the letter, back up by 2 and retrieve that letter to decipher the code. That means the result will be break because backing up 2 letters from d gets b and backing up two letters from t gets r etc. Note that for extra credit you should include the code that when you start with a backing up 2 gets y and when you start with b, backing up 2 gets z.
Basic decode
Code for above
Assignments:
I want you to create a table to store information from a form including the persons name and their email and other fields you feel would be useful like date.
I want you to put up a form to take in a persons information, store it in the table and send yourself an email with the information and direct the user to a thank you page.
I want you to finally send a email message to all of the people on your table.
In class on Wednesday, we worked on a decoding problem. My solution is not complete, for extra credit you can finish it off.
Functions:
I want you to write the name flip you did in MySql using PHP.
Given a student first name, last name, year of birth, and student id you must generate a password: The password is to use the first characters of the last name in upper case followed by the third and fourth characters of the first name in lower case, followed by a random character selected from the following ( _ # * &) followed by the fifth and sixth numbers in the id, followed by the last character of the first name in upper case followed by the last character of the last name in lower case followed by the middle two digits of the year of birth.. If there are less than the number of needed characters in the first or last name, you should substitute * for the character.
Week #12
Week of April 19th
I will be around Tuesday at 10 and 2 and Wednesday after 2.
We will look at email today.
Previous handouts, some duplicates:
Email examples
Email examples
Email and DB example
Zipped email examples
When you make your email, please remove my addresses and only send me things you are submitting for a grade! Assignments:
Send me one or more emails that include the features we went over: images, tables, text etc.
Week #11
Week of April 12th
Advisement starts this Tuesday (I am starting a day early, check my door K112).
We will continue with connections this week and look at updating the database (note I made some changes so these do not exactly match what we are looking at.
Update connect examples
Update html and php examples
We are going to continue to look at connecting to databases and we will start looking at images in a database.
Working with images
Images address on database
Another random image example
The examples are zipped under examples.
Assignments:
Your assignment is to write code to update a database table. I want you to let the user choose whether they want to add, change or delete. I then you want to take in the needed data and make the add, change or delete happen. I want a far better than my update. If your update is basic like mine, the maximum grade is a B.
Quiz on databases and images
Your assignment is to write code to update a database table.
Week #10
Week of April 5th
Thursday April 8th at 12:30 in C111: The CIS Department is sponsoring a speech which deals with Crimes against Children with emphasis on the impact of the Internet. The speech is by Paul Graf, Special Agent, US Naval Criminal Investigative Services Specialist and is titled The 'Real' NCIS! Investigating Crimes Against Children.
I have heard him speak and he is very good, so please try to find the time to come, listen and learn!
This certification might be of interest to you or of interest to someone you know.
Free Technology Training Partnership with Microsoft
I will be available Monday after my classes, Tuesday at 10 and 1:40, Wed at 1:45 and you can check with me about seeing me before or after the speech on Thursday.
Here are some handouts that contain the code for some of the examples:
Connect examples
Connect examples cont
More connect examples
We will look at the examples in this zipped collection:
Second set of connect examples
Connect maintain
Printouts of some of the examples:
List columns, create table, drop table code
Fourth set connect examples
Update connect examples
Assignments:
Exercise using php and mysql table - do not have to pass in,but make sure you know how to do these things
This is the assignment to pass in: I want you to experiment with connecting and retrieving information from database tables. I want 4 different programs that include displaying all the records, displaying a particular record, and display from multiple tables and something you want to try.
Week #9
Week of March 29th
I will be available at 10 and 1:45 on Tuesday if you need help. I have a meeting on Monday and a doctor's appointment right after class on Wednesday. Hopefully things will become more normal next week.
The CIS Department is sponsoring a speech which deals with Crimes against Children with emphasis on the impact of the Internet. The speech is by Paul Graf, Special Agent, US Naval Criminal Investigative Services Specialist and is titled The 'Real' NCIS! Investigating Crimes Against Children. We are going to continue looking at arrays.
Global variables PHP
We will also look at the binhex.php example under binary examples: Binary hex program to run
Binary zipped examples
Connect introduction zipped examples
connectfirstS10.doc
Assignments:
Analysis of showbinary.php: I want you to give a detailed analysis of the program showbinary.php. In the process, I want you to look for errors and suggest fixes if you find any.
Your second assignment is to write a guess the number game using the structure that I used in the showbinary and binhex examples. The game should let you keep trying until you guess it and it should give you feedback about too high or too low.
Not to pass in: Please make sure you connect and access a database and display data using the basics in connectfirstS10.doc.
Week #8
Week of March 22nd
I will not be on campus this week, I had a few complications from the surgery and need a little more time to recover. I would like you to continue to explore the array examples that I have had my site. I will be uploading some more examples.
I am providing some extra examples and asking you to experiment with arrays. My suggestion would be to go to class and treat it like a lab to ask each other questions etc.
I came across a problem inserting an array value in the string we wanted to put out with echo or print. A little research shows the solution - you need to enclose the value coming from the array in curly braces.
echo("$ct1 + $ct2 = {$mathArray[$ct1][$ct2]}<br>");
Additional zipped examples to help with the homework assignment!
Reference on sorting
Assignments:
Array assignment
Vacation
Week of March 15th
Have a nice break and lets all try to get caught up!
Week #7
Week of March 8th
I will be available Monday at 4ish (have a meeting at 2), Tuesday at 10 and at 1:45 and Wednesday at 1:45 I think, check back. I will be in K101 or K112.
We will continue the in class assignment on Monday and then move on to the basics of arrays. Download the examples and start to look them over, we will do some in class. We will continue with arrays after break.
Assignments:
In class array assignment, if you were not in class, I want you to do the assignment and send it to me.
I want you to write a program similiar to the one I wrote which can be run from: Math Array
The statements Multiply by 0, Multiply by 1 are stored in a one dimension array and displayed. You need to extract the message from the array and display it before you show each group. You are going to display the math facts and the answers. The answers need to be stored in a two dimensional array. Set up a two level table to print out the math facts and get the answer from the two dimensional array. The two multipliers are the indexes that allow you to extract the answer. I used a nested while loop to do this.
Week #6
Week of March 1st
I will be available Monday at 4ish (have a meeting at 2), Tuesday at 10 and at 1:45 and Wednesday at 1:45. Check back, there is one unresolved meeting time!
This week we will start talking about multiple tables in the MySQL database. We will look at the definition of third normal form and relationships and how these can work in MySQL.
Multiple tables
Keys and indexes
Subqueries
Index, subquery etc.
Assignments:
SQL play computer assignment - we will start in class on Wednesday and continue next Monday. This is an assignment that everyone should pass in.
Week #5
Week of February 22nd
I am available Tuesday at 10 in K112, at 1:45 in K101 and Wednesday sometime around 3 in my office.
We are going to leave PHP for a while and focus on MySQL. Please check out some tutorials.
Beginning MySQL notes
Data types
More SQL
Assignments:
SQL assignment
Note that in the sample, I took an example I had used in Oracle. You need to check out how to do the date in MySQL.
Start working on the second SQL assignment, we will continue with SQL next week.
MySQL assignment: Second SQL assignment
Again, for those who took Oracle, please notice the similarities and differences.
Week #4
Week of February 15th
This week we will continue with if statements, Boston Tea Party, and we will start loops.
Supplemental instruction is available this week:
•  Tuesday 1:45 to 3 with me in K101
•  Wednesday 1:45 on with me in K112 or lab with note on my door

Look at the loop examples.
We are starting to look at MySQL. First we are going to look at it through putty and then we will incorporate it into PHP.
You will be accessing MySQL on the cisweb server. Information about MySQL is available at their web site. MySQL site
Information about using it at BCC is on this handout. Using MySQL on the cisweb server
If you want a copy to work with at home, a copy is available on the CDs accompanying the text book or at this site.
Please look at the presentations under MySQL on using MySQL. Note: You will need your cisweb username and password. If you have not gotten it yet, contact me. You should also get a copy of PuTTY to use with MySQL if you plan to work from home. PuTTY is available in the labs. Two sites that can be used to download PuTTY are:
PuTTY
PuTTY
Here is an example sheet for use when you are creating databases and tables in putty: Using putty to create a database and table
Here is another example sheet for use when you are maintaining and doing queries similiar to the ones I have assigned. Using SQL with MySQL
You should be looking up tutorials on SQL. Two that I think are good are:
SQL Tutorial (based on MySQL)
A Gentle Introduction to SQL This is especially helpful for someone who has had Oracle because it shows comparisons between the two versions.
You are allowed to have two databases (each can have multiple tables), under your cisweb. I have sent the names of the databases to your BCC accounts.
Assignments:
Loops assignment
Week #3
Week of February 8th
The HTML assignment should be passed in by February 7th. Even if it is late, send it in because it only drops 10 points a week. If you have questions, send me what you have and I will note that I got something and try to help you get it fixed.
I will be available for help on Tuesday from 10 to 11 in my office or in K101 and I will have a help lab Tuesday from 1:30/1:45 to 3:00ish. On Wednesday I will be available from 1:45 until around 3 in my office. We can go to a lab if you need help.
We will start looking at the Boston Tea Party game and if statements this week including additional structures. You should download the decisions and decisions plus examples.
You should read chapter #3 in the PHP/MySQL Programming text book. Please read along in the text book at the rate of about a chapter a week. I really think of the textbook largely as a reference.
Please look at "Go West Across America with Lewis and Clark" which is where I got the idea for the Boston Tea Party game. Lewis and Clark adventure
Assignments:
I would like you to write an educational game for kids about some event or series of facts. It should be something along the lines of what I did for the Boston Tea Party. We will then post it to the CIT32 site and make the menu.
Week #2
Week of February 1st
I will be available for help on Tuesday from 10 to 11 in my office and I will have a help lab Tuesday from 1:30/1:45 to 2:00 and then 2:30ish to 3:00 (I can stay until 3:30). Sorry someone asked me to go to a meeting at 2 and I really need to go for a while.
On Wednesday I will be available from 1:45 until around 3 in my office. We can go to a lab if you need help.

Handout on using WinSCP3 Note that there is a later version available if you choose to use it.
Please look at the beginning PHP examples and the beginning PHP PowerPoints. The examples are under Beginning PHP examples. They are zipped. The presentations are under PHP fundamentals and are called Beginning PHP. More PHP examples
You should also read chapter #1 and start reading chapter #2 in the PHP 5/MySQL Programming text book. Note that you are doing PHP and MySQL on our server so you do not have to attempt to set up.
We will see where we get, I probably will post something else.
Assignments:
First PHP assignment
Put this up on the web. Send me the code and the address.
We will work on this project in class, I need everyone to do it and pass post it on the server and send me the code and the adress: Memo assignment.
Make up 5 names and use the 7 days of the week.
Week #1
Week of January 25th
Read chapter #1 in PHP/MySQL Programming. We will start off the semester with HTML/XHTML. If you have already had CIS44 or have previous experience, this will be a review. If you have taken CIS17, you have already been introduced to HTML. For others I suggest that you read chapter #1 carefully and use resources at the page for CIS44 or other resources on the web to accquaint yourself with HTML.
The students in this class have a variety of backgrounds, so for some HTML is review and for others it is relatively new.
Handout on using WinSCP3
Note that WinSCP3 is available as open source software and you can download it for home use.
When logging in at school, you should not enter your password and you should not save. If you do not enter the password you are prompted for it in a session, but it is not saved. This provides you with some security for your site. You should be getting a username/password for the BCC site at the end of this week.
We will be working exclusively off the BCC site. You do not need to install PHP or MySQL, they are on the server.
Assignments:
If you are new to HTML, I want you to build a web page and upload it to the server (that cannot be done until you get your username and password). The page should include at least list, tables, CSS and forms.
If you are experienced with HTML, I want you to develop a page that challenges you and uses elements that you stretch your knowledge - this is the time to explore more CSS or forms - experiment!
Due in two weeks. Hopefully I will have your server login information soon - if not we will extend the due date.
As always, check back!

Google
WWW www.pgrocer.net

Send e-mail to Mrs. Grocer:
pgrocer@bristol.mass.edu

Back to the Top
Return to home page
Return to previous page