MySQL and PHP - CIS159/CIT32

Weekly Schedule

Remember RE-SUBMIT. If you get back a homework with errors and without a grade it means it has not been graded - you need to fix and resubmit to get a grade.

Homework is due the last day of class (May 10th). I will take a few things late if you have been involved in the class (coming to class and/or communicating regularly if you are a distance learning student and/or doing assignments). Check with me.

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! For almost all the assignments I want to see the code you write and the output it produces. So send me the address and a copy of the code. With play computer assignments give me the code and the output as you feel it would be generated. Please keep copies of all work you submit until you receive your final grade at the end of the semester. Remember that I tape all my classes and capture notes on the Smartboard. These are available to you under Audio and Smartboard.
Week #15
Week of May 7th
Tues and Thurs will be an open lab to get caught up from 9:30AM to 3:30PMish. Please come if you need help because Lindsey and I will both be available. Your final is a take-home, open notes, open book final.
Your final is due on Thursday, May 18 at 9:00AM. It must be mailed to the regular email address with a cc to
Final Exam
Status Sheet
Week #14
Week of April 30th
Lindsey will be available at 2 on Tues and Thurs and I will be around as well.
If you would like me to check for things that do not have a grade, fill in this status sheet and send it to me with the work you have done.
Status Sheet Apparently I made a mistake and there is a quiz under week #3 on decisions that never happened.
Note that a revised version of this is due at the final.
This week we will continue with email and also look at cookies and sessions.
cookies session zipped
More on session guess games
As always, check back.
Inside Sessions Guess there is a program called registration.php that I want you to explain.
I also want you to write a program that uses sessions to take in information and display it on another page.
Week #13
Week of April 23rd
Lindsey will be available Tues and Thurs at 2. We will be looking at emails this week.
I am out with a stomach bug. I will post email using PHP information for you to work on today since that was what I was going to go over in class.
Email Group One PHP zipped
Email Group Two PHP zipped
Note the problems with color - it is best to do it embedded in the tags. We will look at email with a database on Thursday.
Check back!
First: Make a email using html and php. It should include an image, color and several different html features.
Second: Set up a database table with idno, name, email and major. Send an email to everyone in the database. Clearly I should be in the database. Note we did not get to this in class - we will look at it next Tuesday, but you can check it out under the second email group. It is emaildb.php.
Please test sending it to yourself and only send me the email when it is working - you need to send it to my BCC email and my usual homework email address. You need to also send something to my regular homework email account telling me it was sent and the date and time... Just in case!
Week #12
Week of April 16th
Lindsey will be available Tues and Thurs at 2 and I will be available for advisement and help. I am also available Thursday at 10 in my office.
We will look at images this week.
Images First Group PHP zipped
Images Second Group PHP zipped
Check back!
Quiz on databases and images Just to clarify when you bring up a random picture I want the address taken from the database table to be used. Really more like homework!
Week #11
Week of April 9th
More on arrays.
Array Group Second PHP zipped
Array Group Third PHP zipped
Math Array
Assignment: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 and another time I used a nested for loop.
Dave said there is a lot of confusion so here is something that might help... So there should be one array that has messages in it: Multiply by 0, Multiply by 1 etc. Every time you change to multiply by a different number, you display one of them. Then you are going to set up a loop with i and j or x and y whatever. To get the answer you want to display you need to go to a two dimensional array that contains the answers and extract them using the i and j or x and y or whatever. So for the first problem i is 0 and j is 0 so you use those to go to the two dimensional table and extract the answer of 0. For the last problem k is 4 and j is 4 so you use those to go to the two dimensional table and extract the answer of 16. It is kind of like extracting the miles from one city to another using two indexes (from city and two city). Here you are using two indexes that are the two numbers you are multiplying. A few more arrays
Week #10
Week of April 2nd
This week is a hybrid week and actually a catch up week. If you are behind I strongly suggest you go to the help labs that are Tuesday, April 3rd from 9:30 until 3:00 and Thursday, April 5th from 9:30 until 3:00. Lindsey will be there to help and hopefully there will be classmates you can talk to as well.
Check back!
Week #9
Week of March 26th
This week we are looking at the binhex program under FunctionGroupPHP and the updates under UpdateFunctionPHP.
Array Group First
Woops... There was something that I already assigned last week here as well. It is gone now.
You need to write an update program that can add, change or delete the fields on a table. I am looking for effective maintenance and something easy for the user to work with. If you need some extra time on this, let me know.
Week #8
Week of March 19th
We will start the week looking at more connection examples. We need to work more on SecondConnectGroupOK and then we will move on to ThirdConnectGroupOK and FunctionGroup.
Third Connect Group
Function assignment
Check back!
Week #7
Week of March 5th
We will finish up our quick introduction to MySQL and using SQL on Tuesday and start incorporating it into PHP.
First Connect Group zipped
Connect Explanation
Second Connect Group OK
MySQL PHP assignment
Check back!
Week #6
Week of February 26th
I will be around for help after 2 on Tues and Thurs.Dave is available for help but he needs you to contact him and set up a time. His email is
We will work with MySQL/MariaDB and Putty and there are a lot of resources on the web for reference.
We will start with these and move on as time allows:
Beginning MySQL notes
Data types
More SQL
Keys, indexes etc.
Multiple tables
workingwithSQL.doc Something we will start in class and continue next week - show me the output that would be produced.
SQL Assignment 2
Week #5
Week of February 19th
Dave will be available from 4:00 to 6:30 on Wednesday in K118.
Please be sure you have looked at the examples in the FifthGroupPHP.
We will look at getting into MySQL and the notes from last week.
SQL assignment I know the directions say picture of screen but in fact I would prefer just copying the output and pasting it in so it is more readable - check putty directions for doing this!
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.
Week #4
Week of February 12th
I am out sick this week.
We will look at Fourth Group PHP and Fifth Group PHP and then start to look at MySQL.
Fifth Group PHP zipped
Beginning MySQL notes
MySQL and putty
Using Putty in MySQL as of Feb 16,2016
I heard back from Eric and apparently we are now using MariaDB instead of MySQL at the prompt. However they changed the prompt back to MySQL so...
Experiment with MySQL please.
Check back!
Loop Quiz: without loop program Please download this program and modify it three times. Once to use a while loop, once to use a do...while loop and once to use a for loop.
Program to write: Write a program to do the algebraic equation x = a +a(b+4)/2 multiple times within loops that vary a and b. The variable a should start at 1 go to 10 and increment by 1. The variable b should start at 2 and go to 10 and increment by 2. When you display the answer show the formula in php. I want you to do this three times: once with a, once with a do...while and once with a while.
Week #3
Week of February 5th
I will be available Monday at 10 in my office K112 and Tuesday and Thursday at 2 in K101 (hopefully).
We will work on information in ThirdGroupPlusPHP and BostonTeaPHP. We may get to FourthGroupPHP.
Third Group Plus PHP zipped
Boston Tea party example PHP zipped
Fourth Group PHP zipped
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 4 pages.
Check back!
Week #2
Week of January 29th
I need to reschedule my Tuesday office hours - I will be available later Tuesday afternoon and Thursday at 2.
We will continue with PHP looking at Second Group PHP and Third Group PHP. You can find Second Group PHP at Second Group PHP
You can find Third Group PHP at Third Group PHP
Because a text book is not required, I want to point you to a few good PHP tutorials/ references that you can use throughout the semester. I will also put up sites related to current topics periodically.
Tutorials Point (PHP)
The W3 schools tutorial gives you option to test things
A slow moving basic tutorial
To load things up on the Internet, we use WINSCP. Please read the WINSCP and cisweb information: (note that in my examples I use as the host, we are now using as the host although the old one is still supported).
Here is information about using cisweb and WINSCP at BCC
Talks more specifically about portfolio We will be looking at making a portfolio later in the semester.
If you want to download WINSCP at home, you can find it at this address.
IF Assignment
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.
Week #1
Week of January 22nd
We will start off the semester with a quick review of HTML if needed and then we will actually start the PHP. 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 use resources at the sites for CIS120/17 and CIS122/44 or other resources on the web to accquaint yourself with HTML.
This example covers some of the fundamentals: html5example.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 instead of the host as we are now using
WinSCP3 is available as open source software and you can download it for home use.
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 cisweb site. You do not need to install PHP or MySQL, they are on the server.
When we start to look at PHPlog into cisweb and copy my examples from First Group PHP up to the site.
You can find First Group PHP at First Group PHP revised - a few things have been added
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 the Thursday after the week it is assigned so due February 1st.(Note that homework is always due the Thursday of the week after it is assigned unless I give a specific due date - usually because I want to go over the assignment).
For all assignments and quizzes, send me the address that I can run in the browser to test your program and also send a copy of the code.
Check back after we have worked Quiz this is one of those quizzes where you can talk things through with others in the class, but each person has to do it and pass in their version.

Send e-mail to Priscilla Grocer:

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