MySQL and PHP - CIS159/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.
Unit #15 This is the final unit, the final is due by the 22nd of August. Let me know when you want me to send it. You can have a week to work on it.
Unit #14 This week I would like you to do some research on Ajax and experiment with using it to integrate into PHP.
Assignments:
Send me something that integrates Ajax into PHP to access data.
Unit #13 This unit we will look at functions some more and we will look briefly at sessions and cookies.
functionsforS12.7z
sessionscookieheaderetcS12.zip
I will post your final with the next unit.
Assignments:
In the collection of programs above there is a program called codeproblem.php. It works unless the word to decode contains an a and/or b, your assignment is to fix the problem so it can handle a word containing a and/or b.
For extra credit on the program set it so you take in a word of any length and decode it.
Homework: Do something with sessions where you pass information from one page to another and end the session and then try to pass. Experiment so you do not duplicate my experiment. Do something with cookies, again experiment.
Unit #12 This unit we will start out by looking at email within PHP. We will also look at examples of email using databases.
Email examples
Database Email examples
Note that the way BCC has the email feature set up, you can only use bristolcc.edu or bristol.mass.edu emails from cisweb.
Assignments:
You need to send an email to the regular address telling me the email has been sent and what email you sent it to and what date. You also need to use my email that goes to mail.bristol.mass.edu.
First: Send me one or two emails that include things like an image, color, table, list etc - your choice except I want an image definitely.
Second: Make a simple database table with a name and email in it (make two records have my two example emails and one have yours). Then write a php email script to send an email to everyone on the database table.
Unit #11 We will continue looking at image examples.
Assignments:
Quiz on databases and images
Unit #10 This unit we are dealing with functions and with input and processing in a PHP page. Start to look at images.
getprocphp.doc Note issue in third
binary.zip
showbinaryyes1.doc
Assignments:
Fix the program called binhex.php that is located in the binary.zip. Use showbinaryyes.php as a guide (or showbinaryyes1).
Write the program to guess a number between 1 and 25. This assignment needs to be passed in prior to April 24th because I want to go over it during that class. Note that it should be written on one page - what I mean is the input for the guess and the processing should be on the same php.
Unit #9 Examples - the first group has a lot of SQL in PHP and the second has the maintenance of MySQL through PHP.
Examples to discuss in class
connectmaintainS10.zip
Assignments:
Your assignment is to create a table using php script. The table should have 5 fields with an least one numeric field. You then need to populate the table with at least 5 records.
Next, I want you to write code to update your database table. I want you to let the user choose whether they want to add, change or delete (this means presenting all choices and acting on their decision). I then you want to take in the needed data and make the add, change or delete happen. I want yours to be far better than my update, in other words you should be able to update all but the key field. If your update is basic like mine, the maximum grade is a B.
Unit #8 SQL play computer assignment from last unit if you did not finish it
Please be sure to look at some more array concepts.
Examples from class that were not at site - dealing with array of colors
Just to make sure you have all of the major examples:
Connect introduction zipped examples
connectfirstS10.doc
Here are some handouts that contain the code for some of the examples:
Connect examples
Connect examples cont
More connect examples
We looked at the examples in this zipped collection:
Second set of connect examples
Examples Spring 2011
Assignments:
PHP array assignment
Unit #7 We will do a little more with SQL and talk about connecting to a database table.
We will also start looking at arrays because it will help to understand how the data is stored. We did get started on arrays but only basic arrays and simple two dimensional using arrays.
Assignments:
SQL in PHP
SQL play computer assignment On this assignment I want you to figure out the results, I do not want you to submit to SQL - it truly is a play computer assignment.
Unit #6 We went through a good deal of the SQL examples this - check the Smartboard from the spring semester to see what we did.
We will continue with relational databases and SQL and how to use multiple from a database using SQL. The Smartboard and audio are for week #6 and #7 since we had technical problems in class.
Assignments:
Payroll database Explanation to use below
Relational Database Assignment
Unit #5 Notes:
Keys, indexes etc.
Subqueries
Multiple tables
Functions
Assignments:
MySQL assignment: Second SQL assignment
Again, for those who took Oracle, please notice the similarities and differences.
Unit #4 Again let me stress that you should work at your own pace but you need to finish 15 units by the end of the summer. I am posting the units every couple of days to give you the flexibility to plan your work. Do not feel pressured to do the units as they are posted. Start with unit #1 and move forward at a pace that works for you. I recommend a minimum of one unit per week and clearly some weeks you will have to do two in order to finish by the end of the summer semester.
This unit we will look at examples of loops and that will finish the fundamentals.
This unit we are also going to start looking at MySQL. I want to get the fundamentals of both PHP and MySQL out of the way!
Your book covers this I think in chapter #9, so...
First we are going to look at MySQL 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
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
Putty Notes
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.
Beginning MySQL notes
Data types
More SQL
Assignments:
Loop assignment
SQL assignment Play with this but we will go over SQL next week and you can have a couple of extra days.
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.
Unit #3 We started class with an exercise using quotes In class exercise This does not have to be passed in, but I suggest you experiment with it.
Note if you change the .txt to .php you will see the results.
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
Note - depending on the version you look at there is a factual error in the Boston Tea Party game having to do with checking the answer - somehow I reversed the check.
This week we are going to look at decisions and developing a multipage site. Depending on time, we may start loops.
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. It should have a minimum of 3 pages.
IF statement assignment If you would like to use the case stucture in a more classical way, you can add in your own problem to use the case structure.
Unit #2 If you have any questions, please be sure to email me!
I am putting up the first few units at a fairly fast pace to give you the flexibility to do things on your own schedule. There will be a total of 15 units so you need to schedule yourself to make this work. Be sure to look at the Smartboard notes and the audio for Spring 2012. We are essentially doing the same class.
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 combined Spring 2011. You should also read chapter #1 and start reading chapter #2 in the PHP 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.
Zipped explanation of some of the beginning programs
Assignments:
For all assignments, send me the address that I can run in the browser to test your program and also send a copy of the code.
Quiz: Quiz
Homework: Memo assignment Make up 5 names and use the 7 days of the week. and notice in my example I have you select a first name but I put out the whole name. You can make up the names. Also note that the select is Wed but in the memo I use Wednesday.
Unit #1 Since the summer has less weeks than the other semesters, I use units in the summer. You will have the same 15 units that I give every other semester and you will have to decide how to handle the extras, I will start posting them this week to give you the flexibility to get through them at a pace and on a schedule that works for both of us.
Read chapter #1 in PHP/MySQL Programming. We will start off the semester with HTML/XHTML. If you have already had CIS122/44 or have previous experience, this will be a review. If you have taken CIS120/17, you have already been introduced to HTML. For others I suggest that you read chapter #1 carefully and use resources at the page for CIS122/44 or other resources on the web to accquaint yourself with HTML.
A great reference for writing HTML is W3Schools
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.
We will experiment with logging in to the server and look at some of the examples at the site located in Beginning PHP examples zipped under Site Resources/Code Examples.
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!

Google
WWW www.pgrocer.net

Send e-mail to Priscilla Grocer: Priscilla.Grocer@bristolcc.edu

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